+    height: 48rpx;
15
+    background-color: @color-bg;
16
+    border-radius: 24rpx;
17
+
18
+    image {
19
+      width: 28rpx;
20
+      height: 28rpx;
21
+    }
10 22
   }
11 23
 
12 24
   .num {
13
-    padding: 0 @spacing-short-text;
25
+    min-width: 24rpx;
26
+    padding: 0 @spacing-text;
14 27
     color: #000;
15 28
     text-align: center;
16 29
   }

+ 6 - 2
src/component/stepper/stepper.wxml

@@ -1,5 +1,9 @@
1 1
 <view class="stepper">
2
-  <image class="icon" src="minus.svg" bindtap="bindminus" wx:if="{{ num !== 0 }}"></image>
2
+  <view class="icon">
3
+    <image src="{{num === 1 ? 'minus1' : 'minus2'}}.svg" bindtap="bindminus"></image>
4
+  </view>
3 5
   <text class="num" wx:if="{{ num !== 0 }}">{{ num }}</text>
4
-  <image class="icon" src="add.svg" bindtap="bindadd"></image>
6
+  <view class="icon">
7
+    <image src="add.svg" style="fill:#000" bindtap="bindadd"></image>
8
+  </view>
5 9
 </view>

+ 14 - 3
src/component/stepper/stepper.wxss

@@ -1,13 +1,24 @@
1 1
 .stepper {
2 2
   display: flex;
3 3
   align-items: center;
4
+  justify-content: center;
4 5
 }
5 6
 .stepper .icon {
6
-  width: 72rpx;
7
-  height: 72rpx;
7
+  display: flex;
8
+  align-items: center;
9
+  justify-content: center;
10
+  width: 48rpx;
11
+  height: 48rpx;
12
+  background-color: #efefef;
13
+  border-radius: 24rpx;
14
+}
15
+.stepper .icon image {
16
+  width: 28rpx;
17
+  height: 28rpx;
8 18
 }
9 19
 .stepper .num {
10
-  padding: 0 4rpx;
20
+  min-width: 24rpx;
21
+  padding: 0 12rpx;
11 22
   color: #000;
12 23
   text-align: center;
13 24
 }

+ 10 - 4
src/pages/index/index.js

@@ -23,9 +23,17 @@ app.routerInterceptor.checkLoginStatus({
23 23
   /**
24 24
    * 生命周期函数--监听页面加载
25 25
    */
26
-  onLoad() {
27
-    this.getData()
26
+  onLoad(options) {
28 27
     wx.hideHomeButton()
28
+    const { room_id } = options
29
+    if (room_id !== undefined) {
30
+      wx.redirectTo({
31
+        url: `/pages/live/anchorHome/anchorHome?room_id=${room_id}`
32
+      })
33
+
34
+      return
35
+    }
36
+    this.getData()
29 37
   },
30 38
 
31 39
   getData() {
@@ -69,8 +77,6 @@ app.routerInterceptor.checkLoginStatus({
69 77
   bindstepperChanged(e) {
70 78
     const { nums, commodities } = this.data
71 79
     nums[e.currentTarget.dataset.index] = e.detail
72
-    console.log(commodities)
73
-    console.log(nums)
74 80
     const total = commodities.reduce(
75 81
       (accumulator, cur, index) =>
76 82
         accumulator + (cur.price * 100 * nums[index]) / 100,

+ 5 - 3
src/pages/index/index.less

@@ -148,7 +148,7 @@ page {
148 148
       .commodity-left {
149 149
         .flex-center(row);
150 150
 
151
-        height: 200rpx;
151
+        height: 220rpx;
152 152
 
153 153
         .commodity-img {
154 154
           width: 180rpx;
@@ -158,6 +158,7 @@ page {
158 158
         .commodity-content {
159 159
           display: flex;
160 160
           flex-direction: column;
161
+          width: 360rpx;
161 162
           height: 100%;
162 163
           margin-left: @spacing-item;
163 164
 
@@ -190,6 +191,7 @@ page {
190 191
       display: flex;
191 192
       flex-direction: column;
192 193
       align-items: flex-end;
194
+      justify-content: flex-end;
193 195
       width: 100rpx;
194 196
       height: 100%;
195 197
 
@@ -210,14 +212,14 @@ page {
210 212
           display: flex;
211 213
           flex-direction: column;
212 214
           align-items: flex-end;
213
-          width: 200rpx;
214 215
           height: 40rpx;
215 216
           margin-top: @spacing-inline;
216 217
 
217 218
           text {
218
-            padding: 0 @spacing-short-text;
219
+            padding: 0 8rpx;
219 220
             font-size: @font-label;
220 221
             color: @color-bg;
222
+            white-space: nowrap;
221 223
             background-color: @color-light-gray;
222 224
             border-radius: @radius;
223 225
           }

+ 8 - 6
src/pages/index/index.wxss

@@ -91,7 +91,7 @@ page {
91 91
 .commodity-container .commodity-title-container .title {
92 92
   font-size: 14pt;
93 93
   font-weight: 600;
94
-  color: #000;
94
+  color: #111;
95 95
 }
96 96
 .commodity-container .commodity-title-container .expired {
97 97
   margin-top: 4rpx;
@@ -121,7 +121,7 @@ page {
121 121
 .commodity-container .commodity-list .commodity-item .commodity-left {
122 122
   display: flex;
123 123
   align-items: center;
124
-  height: 200rpx;
124
+  height: 220rpx;
125 125
 }
126 126
 .commodity-container .commodity-list .commodity-item .commodity-left .commodity-img {
127 127
   width: 180rpx;
@@ -130,6 +130,7 @@ page {
130 130
 .commodity-container .commodity-list .commodity-item .commodity-left .commodity-content {
131 131
   display: flex;
132 132
   flex-direction: column;
133
+  width: 360rpx;
133 134
   height: 100%;
134 135
   margin-left: 24rpx;
135 136
 }
@@ -155,6 +156,7 @@ page {
155 156
   display: flex;
156 157
   flex-direction: column;
157 158
   align-items: flex-end;
159
+  justify-content: flex-end;
158 160
   width: 100rpx;
159 161
   height: 100%;
160 162
 }
@@ -174,14 +176,14 @@ page {
174 176
   display: flex;
175 177
   flex-direction: column;
176 178
   align-items: flex-end;
177
-  width: 200rpx;
178 179
   height: 40rpx;
179 180
   margin-top: 12rpx;
180 181
 }
181 182
 .commodity-container .commodity-list .commodity-right .stepper-container .bought-tip text {
182
-  padding: 0 4rpx;
183
+  padding: 0 8rpx;
183 184
   font-size: 8pt;
184 185
   color: #efefef;
186
+  white-space: nowrap;
185 187
   background-color: #959595;
186 188
   border-radius: 5px;
187 189
 }
@@ -226,7 +228,7 @@ page {
226 228
   margin-left: 12rpx;
227 229
   font-size: 11pt;
228 230
   font-weight: 600;
229
-  color: #000;
231
+  color: #111;
230 232
 }
231 233
 .consumer-container .consumer-item .consumer-info .time {
232 234
   margin-top: 4rpx;
@@ -257,7 +259,7 @@ page {
257 259
   height: 160rpx;
258 260
   padding: 24rpx;
259 261
   background-color: #fff;
260
-  box-shadow: 0 -5px 9px 2px rgba(0, 0, 0, 0.1);
262
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
261 263
 }
262 264
 .btn-footer .btn-footer-container {
263 265
   display: flex;

+ 42 - 0
src/pages/live/anchorHome/anchorHome.js

@@ -0,0 +1,42 @@
1
+const WxParse = require('../../../utils/wxParse/wxParse.js')
2
+
3
+const app = getApp()
4
+
5
+app.routerInterceptor.checkLoginStatus({
6
+  /**
7
+   * 页面的初始数据
8
+   */
9
+  data: {
10
+    anchor: {},
11
+    rooms: [],
12
+    isLodding: false
13
+  },
14
+
15
+  /**
16
+   * 生命周期函数--监听页面加载
17
+   */
18
+  onLoad(options) {
19
+    this.getData(options)
20
+    wx.hideHomeButton()
21
+  },
22
+
23
+  getData(options) {
24
+    const { room_id } = options
25
+    const that = this
26
+    app.network.post({
27
+      url: app.urls.LIVE.ROOM_ANCHOR,
28
+      data: {
29
+        room_id
30
+      },
31
+      success(res) {
32
+        const { anchor, rooms } = res.data
33
+        WxParse.wxParse('intro', 'html', anchor.anchor_intro, that, 5)
34
+        that.setData({
35
+          anchor,
36
+          rooms,
37
+          isLodding: true
38
+        })
39
+      }
40
+    })
41
+  }
42
+})

+ 3 - 0
src/pages/live/anchorHome/anchorHome.json

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": {}
3
+}

+ 67 - 0
src/pages/live/anchorHome/anchorHome.less

@@ -0,0 +1,67 @@
1
+@import './src/style/less/variable.less';
2
+@import './src/style/less/layout.less';
3
+@import './src/style/less/shape.less';
4
+@import '/template/footer/footer.wxss';
5
+@import '/template/btn/btn.wxss';
6
+@import '/utils/wxParse/wxParse.wxss';
7
+
8
+page {
9
+  width: 100%;
10
+  height: 100%;
11
+  background-color: @color-bg;
12
+}
13
+
14
+.wrap {
15
+  box-sizing: border-box;
16
+  display: flex;
17
+  flex-direction: column;
18
+  align-items: center;
19
+  height: 100%;
20
+  background-color: @color-bg;
21
+}
22
+
23
+.header {
24
+  position: relative;
25
+  width: 100%;
26
+
27
+  .banner-img {
28
+    position: absolute;
29
+    width: 750rpx;
30
+    height: 400rpx;
31
+  }
32
+
33
+  .user-info {
34
+    position: relative;
35
+    box-sizing: border-box;
36
+    display: flex;
37
+    align-items: flex-end;
38
+    width: 750rpx;
39
+    height: 200rpx;
40
+    padding: 0 @spacing-item @spacing-item;
41
+    margin-top: 200rpx;
42
+    background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
43
+
44
+    .avatar {
45
+      width: 100rpx;
46
+      height: 100rpx;
47
+      border-radius: 6px;
48
+    }
49
+
50
+    .nickname {
51
+      margin: 0 0 @spacing-inline @spacing-inline;
52
+      font-size: @font-primary;
53
+      color: #fff;
54
+    }
55
+  }
56
+}
57
+
58
+.main {
59
+  box-sizing: border-box;
60
+  width: @visual-width;
61
+  margin-top: @spacing-view;
62
+}
63
+
64
+.anchor-intro {
65
+  width: 100%;
66
+  margin-top: @spacing-item;
67
+}

+ 24 - 0
src/pages/live/anchorHome/anchorHome.wxml

@@ -0,0 +1,24 @@
1
+<view
2
+  style="postition:z-index:999;background-color:#fff;width:100%;height:100%;"
3
+  wx:if="{{ !isLodding }}"
4
+></view>
5
+<scroll-view
6
+  class="wrap"
7
+  scroll-y="{{ true }}"
8
+  enable-flex="{{ true }}"
9
+  >
10
+  <view class="header">
11
+    <image class="banner-img" src="{{ anchor.banner }}"></image>
12
+
13
+    <view class="user-info">
14
+      <image class="avatar" src="{{ anchor.anchor_avatar }}"></image>
15
+      <text class="nickname">{{ anchor.anchor_name }}</text>
16
+    </view>
17
+  </view>
18
+  <view class="main">
19
+    <view class="anchor-intro">
20
+      <import src="/utils/wxParse/wxParse.wxml"></import>
21
+      <template is="wxParse" data="{{wxParseData:intro.nodes}}"></template>
22
+    </view>
23
+  </view>
24
+</scroll-view>

+ 55 - 0
src/pages/live/anchorHome/anchorHome.wxss

@@ -0,0 +1,55 @@
1
+@import '/template/footer/footer.wxss';
2
+@import '/template/btn/btn.wxss';
3
+@import '/utils/wxParse/wxParse.wxss';
4
+page {
5
+  width: 100%;
6
+  height: 100%;
7
+  background-color: #efefef;
8
+}
9
+.wrap {
10
+  box-sizing: border-box;
11
+  display: flex;
12
+  flex-direction: column;
13
+  align-items: center;
14
+  height: 100%;
15
+  background-color: #efefef;
16
+}
17
+.header {
18
+  position: relative;
19
+  width: 100%;
20
+}
21
+.header .banner-img {
22
+  position: absolute;
23
+  width: 750rpx;
24
+  height: 400rpx;
25
+}
26
+.header .user-info {
27
+  position: relative;
28
+  box-sizing: border-box;
29
+  display: flex;
30
+  align-items: flex-end;
31
+  width: 750rpx;
32
+  height: 200rpx;
33
+  padding: 0 24rpx 24rpx;
34
+  margin-top: 200rpx;
35
+  background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
36
+}
37
+.header .user-info .avatar {
38
+  width: 100rpx;
39
+  height: 100rpx;
40
+  border-radius: 6px;
41
+}
42
+.header .user-info .nickname {
43
+  margin: 0 0 12rpx 12rpx;
44
+  font-size: 14pt;
45
+  color: #fff;
46
+}
47
+.main {
48
+  box-sizing: border-box;
49
+  width: 702rpx;
50
+  margin-top: 36rpx;
51
+}
52
+.anchor-intro {
53
+  width: 100%;
54
+  margin-top: 24rpx;
55
+}

+ 134 - 0
src/pages/live/order/order.js

@@ -0,0 +1,134 @@
1
+const app = getApp()
2
+
3
+app.routerInterceptor.checkLoginStatus({
4
+  /**
5
+   * Page initial data
6
+   */
7
+  data: {
8
+    hasAddress: false,
9
+    goodsInfo: {},
10
+    address: {},
11
+    order_id: '',
12
+    prepay_id: '',
13
+    total: 0,
14
+    amount: 1,
15
+    isLoading: false
16
+  },
17
+
18
+  onLoad(options) {
19
+    wx.hideHomeButton()
20
+    const that = this
21
+    const { userInfo } = app.globalData
22
+    this.getGoods(options)
23
+
24
+    if (userInfo.consignee_name !== '' && userInfo.consignee_name !== null) {
25
+      that.setData({
26
+        address: {
27
+          userName: userInfo.consignee_name,
28
+          telNumber: userInfo.consignee_phone,
29
+          detailInfo: userInfo.consignee_address
30
+        },
31
+        hasAddress: true
32
+      })
33
+    }
34
+  },
35
+
36
+  getGoods(options) {
37
+    const { room_id, goods_id, share_openid } = options
38
+    const _self = this
39
+    app.network.post({
40
+      url: app.urls.LIVE.GOODS_DETAIL,
41
+      data: {
42
+        goods_id,
43
+        room_id
44
+      },
45
+      success(res) {
46
+        const { goods_info } = res.data
47
+        if (goods_info.price_type === 3) {
48
+          const tmp = goods_info.price
49
+          goods_info.price = goods_info.price2
50
+          goods_info.price2 = tmp
51
+        }
52
+        _self.setData({
53
+          goodsInfo: goods_info,
54
+          anchor_id: res.data.anchor_id,
55
+          room_id,
56
+          share_openid,
57
+          goods_id,
58
+          total: res.data.goods_info.price,
59
+          isLoading: true
60
+        })
61
+      }
62
+    })
63
+  },
64
+
65
+  bindstepperChanged(e) {
66
+    this.setData({
67
+      amount: e.detail,
68
+      total: this.data.goodsInfo.price * e.detail
69
+    })
70
+  },
71
+
72
+  navigateToAddress() {
73
+    const that = this
74
+    wx.chooseAddress({
75
+      success: res => {
76
+        res.detailInfo =
77
+          res.provinceName + res.cityName + res.countyName + res.detailInfo
78
+        that.setData({
79
+          address: res,
80
+          hasAddress: true
81
+        })
82
+      }
83
+    })
84
+  },
85
+
86
+  confirm() {
87
+    const that = this
88
+    app.network.post({
89
+      url: app.urls.LIVE.ORDER_CREATE,
90
+      data: {
91
+        anchor_id: this.data.anchor_id,
92
+        room_id: this.data.room_id,
93
+        share_openid: this.data.share_openid,
94
+        goods_id: this.data.goods_id,
95
+        total_fee: this.data.total,
96
+        amount: this.data.amount,
97
+        name: this.data.address.userName || '',
98
+        phone: this.data.address.telNumber || '',
99
+        address: this.data.address.detailInfo || '',
100
+        body: '尖货接龙'
101
+      },
102
+      success(res1) {
103
+        const { wxpay_params } = res1.data
104
+        that.setData({
105
+          order_id: res1.data.order_id,
106
+          prepay_id: res1.data.prepay_id
107
+        })
108
+        wx.requestPayment({
109
+          timeStamp: wxpay_params.timeStamp,
110
+          nonceStr: wxpay_params.nonceStr,
111
+          package: wxpay_params.package,
112
+          signType: wxpay_params.signType,
113
+          paySign: wxpay_params.paySign,
114
+          success: _ => {
115
+            wx.redirectTo({
116
+              url: '/template/resultView/resultView'
117
+            })
118
+          },
119
+          fail: res2 => {
120
+            if (res2.errMsg === 'requestPayment:fail cancel') {
121
+              app.network.post({
122
+                url: app.urls.LIVE.ORDER_CANCEL,
123
+                data: {
124
+                  order_id: that.data.order_id,
125
+                  prepay_id: that.data.prepay_id
126
+                }
127
+              })
128
+            }
129
+          }
130
+        })
131
+      }
132
+    })
133
+  }
134
+})

+ 6 - 0
src/pages/live/order/order.json

@@ -0,0 +1,6 @@
1
+{
2
+  "usingComponents": {
3
+    "stepper": "/component/stepper/stepper"
4
+  },
5
+  "disableScroll": true
6
+}

+ 248 - 0
src/pages/live/order/order.less

@@ -0,0 +1,248 @@
1
+@import './src/style/less/variable.less';
2
+@import './src/style/less/layout.less';
3
+@import './src/style/less/shape.less';
4
+@import '/template/footer/footer.wxss';
5
+@import '/template/btn/btn.wxss';
6
+
7
+.order-view {
8
+  .flex-center(column);
9
+  .with-btnFooter();
10
+
11
+  width: 100%;
12
+  background-color: @color-bg;
13
+
14
+  text {
15
+    color: @color-black;
16
+  }
17
+
18
+  view {
19
+    color: @color-black;
20
+  }
21
+}
22
+
23
+.address {
24
+  .flex-center(row);
25
+
26
+  box-sizing: border-box;
27
+  width: @visual-width;
28
+  min-height: 80rpx;
29
+  padding: 0 @spacing-item;
30
+  margin: @spacing-item;
31
+  background-color: @color-white;
32
+  border-radius: @radius;
33
+
34
+  .item() {
35
+    .square(40rpx);
36
+
37
+    .icon {
38
+      .full-image();
39
+    }
40
+  }
41
+
42
+  .left {
43
+    .item();
44
+  }
45
+
46
+  .content {
47
+    .flex-center(column);
48
+
49
+    box-sizing: border-box;
50
+    width: @visual-width - 80rpx - @spacing-item * 2;
51
+    min-height: 80rpx;
52
+    padding: @spacing-inline @spacing-item;
53
+
54
+    view {
55
+      .flex-center(row);
56
+
57
+      width: 100%;
58
+      margin-top: @spacing-inline;
59
+    }
60
+
61
+    .top {
62
+      justify-content: flex-start;
63
+
64
+      .name {
65
+        font-size: @font-primary;
66
+      }
67
+
68
+      .phone {
69
+        margin-left: @spacing-item;
70
+        font-size: @font-quaternary;
71
+        color: @color-gray;
72
+      }
73
+    }
74
+
75
+    .bottom {
76
+      font-size: @font-tertiary;
77
+    }
78
+  }
79
+
80
+  .right {
81
+    .item();
82
+
83
+    .arrow {
84
+      .arrow(right; @color-dark-bg; @icon-small-size);
85
+    }
86
+  }
87
+
88
+  &-hover {
89
+    background-color: darken(@color-white, 15%);
90
+  }
91
+}
92
+
93
+.authorization {
94
+  justify-content: center;
95
+
96
+  text {
97
+    margin-left: @spacing-short-text;
98
+    font-size: @font-primary;
99
+    color: @color-brand;
100
+  }
101
+
102
+  .plus {
103
+    .plus(6rpx; @color-brand);
104
+    .square(@icon-small-size);
105
+  }
106
+}
107
+
108
+.goods {
109
+  .flex-center(row);
110
+
111
+  align-items: center;
112
+  width: @visual-width;
113
+  min-height: 200rpx;
114
+  margin-top: @spacing-inline;
115
+  background-color: @color-white;
116
+  border-radius: @radius;
117
+
118
+  .left {
119
+    .flex-center(row);
120
+
121
+    justify-content: center;
122
+    width: 200rpx;
123
+    height: 200rpx;
124
+
125
+    image {
126
+      .square(160rpx);
127
+
128
+      border-radius: @radius;
129
+    }
130
+  }
131
+
132
+  .right {
133
+    display: flex;
134
+    flex-direction: column;
135
+    justify-content: space-between;
136
+    width: @visual-width - 200rpx;
137
+    min-height: 160rpx;
138
+    margin: @spacing-inline 0;
139
+
140
+    .top {
141
+      display: flex;
142
+      flex-direction: column;
143
+      width: 100%;
144
+
145
+      .title {
146
+        font-size: @font-primary;
147
+      }
148
+
149
+      .inventory {
150
+        font-size: @font-quaternary;
151
+        color: @color-light-gray;
152
+      }
153
+    }
154
+
155
+    .bottom {
156
+      .flex-center(row);
157
+
158
+      box-sizing: border-box;
159
+      justify-content: space-between;
160
+      width: 100%;
161
+      padding-right: @spacing-inline;
162
+
163
+      .price-group {
164
+        .flex-center(row);
165
+
166
+        .price1 {
167
+          display: flex;
168
+          align-items: flex-end;
169
+
170
+          text {
171
+            color: @color-gray;
172
+          }
173
+
174
+          .value {
175
+            font-size: @font-secondary;
176
+          }
177
+
178
+          .symbol {
179
+            margin-bottom: 2px;
180
+            font-size: @font-quaternary;
181
+          }
182
+        }
183
+
184
+        .price2 {
185
+          display: flex;
186
+          align-items: flex-end;
187
+          margin-left: @spacing-inline;
188
+
189
+          text {
190
+            color: @color-light-gray;
191
+          }
192
+
193
+          .value {
194
+            font-size: @font-tertiary;
195
+            text-decoration: line-through;
196
+          }
197
+        }
198
+      }
199
+    }
200
+  }
201
+}
202
+
203
+.btn-footer {
204
+  .flex-center(row);
205
+
206
+  position: fixed;
207
+  bottom: 0;
208
+  box-sizing: border-box;
209
+  justify-content: center;
210
+  width: 100%;
211
+  height: @btnFooter-height;
212
+  padding: @spacing-item;
213
+  background-color: @color-white;
214
+  box-shadow: 0 -5px 9px 2px fade(@color-black, 10%);
215
+
216
+  .btn-footer-container {
217
+    display: flex;
218
+    width: 100%;
219
+    height: 100rpx;
220
+    overflow: hidden;
221
+    border: 1px #09bb07 solid;
222
+    border-radius: @radius;
223
+
224
+    &-disabled {
225
+      border: 1px @color-light-gray solid !important;
226
+    }
227
+
228
+    .left {
229
+      .flex-center(row);
230
+
231
+      justify-content: center;
232
+      width: 40%;
233
+      height: 100rpx;
234
+      background-color: @color-white;
235
+
236
+      text {
237
+        font-size: @font-primary;
238
+        font-weight: 700;
239
+        color: #e64340;
240
+      }
241
+    }
242
+
243
+    .right {
244
+      width: 100%;
245
+      height: 100%;
246
+    }
247
+  }
248
+}

+ 79 - 0
src/pages/live/order/order.wxml

@@ -0,0 +1,79 @@
1
+<view class="order-view">
2
+  <view
3
+    class="address"
4
+    hover-class="address-hover"
5
+    bindtap="navigateToAddress"
6
+    wx:if="{{ hasAddress }}"
7
+  >
8
+    <view class="left">
9
+      <image class="icon" src="/resources/common/location.png"></image>
10
+    </view>
11
+    <view class="content">
12
+      <view class="top">
13
+        <text class="name">{{ address.userName }}</text>
14
+        <text class="phone">{{ address.telNumber }}</text>
15
+      </view>
16
+      <view class="bottom">{{ address.detailInfo }}</view>
17
+    </view>
18
+    <view class="right">
19
+      <view class="icon arrow"></view>
20
+    </view>
21
+  </view>
22
+  <view
23
+    class="address authorization"
24
+    hover-class="address-hover"
25
+    bindtap="navigateToAddress"
26
+    wx:elif="{{ !hasAddress }}"
27
+  >
28
+    <view class="plus"></view>
29
+    <text>新建地址</text>
30
+  </view>
31
+  <view class="goods-container" wx:if="{{ isLoading }}">
32
+    <view class="goods">
33
+      <view class="left">
34
+        <image src="{{ goodsInfo.goods_img }}" mode="aspectFit"></image>
35
+      </view>
36
+      <view class="right">
37
+        <view class="top">
38
+          <text class="title">{{ goodsInfo.name }}</text>
39
+          <text class="inventory" wx:if="{{ goodsInfo.inventory > 0 }}"
40
+            >仅剩{{ goodsInfo.inventory }}个</text
41
+          >
42
+          <text class="inventory" wx:else>库存不足</text>
43
+        </view>
44
+        <view class="bottom">
45
+          <view class="price-group">
46
+            <view class="price1">
47
+              <text class="symbol">¥</text>
48
+              <text class="value">{{ goodsInfo.price / 100 }}</text>
49
+            </view>
50
+            <view class="price2" wx:if="{{ goodsInfo.price_type === 3 }}">
51
+              <text class="value">¥{{ goodsInfo.price2 / 100 }}</text>
52
+            </view>
53
+          </view>
54
+          <stepper
55
+            num="{{ num }}"
56
+            bindstepperChanged="bindstepperChanged"
57
+            wx:if="{{ goodsInfo.inventory > 0 }}"
58
+          ></stepper>
59
+        </view>
60
+      </view>
61
+    </view>
62
+  </view>
63
+</view>
64
+
65
+<import src="/template/btn/btn.wxml"></import>
66
+<view class="btn-footer">
67
+  <view
68
+    class="btn-footer-container {{hasAddress && goodsInfo.inventory > 0 ? '' : 'btn-footer-container-disabled'}}">
69
+    <view class="left" wx:if="{{ total > 0 & goodsInfo.inventory > 0 }}">
70
+      <text class="money">¥{{ total / 100 }}</text>
71
+    </view>
72
+    <view class="right">
73
+      <template
74
+        is="iconBtn"
75
+        data="{{btnClass: 'button4', btnTxt: goodsInfo.inventory > 0 ? '立即支付' : '库存不足', disabled: !(hasAddress && goodsInfo.inventory > 0), action: 'confirm'}}"
76
+      ></template>
77
+    </view>
78
+  </view>
79
+</view>

+ 236 - 0
src/pages/live/order/order.wxss

@@ -0,0 +1,236 @@
1
+@import '/template/footer/footer.wxss';
2
+@import '/template/btn/btn.wxss';
3
+.order-view {
4
+  display: flex;
5
+  flex-direction: column;
6
+  align-items: center;
7
+  height: calc(100% - 160rpx);
8
+  width: 100%;
9
+  background-color: #efefef;
10
+}
11
+.order-view text {
12
+  color: #111;
13
+}
14
+.order-view view {
15
+  color: #111;
16
+}
17
+.address {
18
+  display: flex;
19
+  align-items: center;
20
+  box-sizing: border-box;
21
+  width: 702rpx;
22
+  min-height: 80rpx;
23
+  padding: 0 24rpx;
24
+  margin: 24rpx;
25
+  background-color: #fff;
26
+  border-radius: 5px;
27
+}
28
+.address .left {
29
+  width: 40rpx;
30
+  height: 40rpx;
31
+}
32
+.address .left .icon {
33
+  width: 100%;
34
+  height: 100%;
35
+}
36
+.address .content {
37
+  display: flex;
38
+  flex-direction: column;
39
+  align-items: center;
40
+  box-sizing: border-box;
41
+  width: 574rpx;
42
+  min-height: 80rpx;
43
+  padding: 12rpx 24rpx;
44
+}
45
+.address .content view {
46
+  display: flex;
47
+  align-items: center;
48
+  width: 100%;
49
+  margin-top: 12rpx;
50
+}
51
+.address .content .top {
52
+  justify-content: flex-start;
53
+}
54
+.address .content .top .name {
55
+  font-size: 14pt;
56
+}
57
+.address .content .top .phone {
58
+  margin-left: 24rpx;
59
+  font-size: 10pt;
60
+  color: #3e3e3e;
61
+}
62
+.address .content .bottom {
63
+  font-size: 11pt;
64
+}
65
+.address .right {
66
+  width: 40rpx;
67
+  height: 40rpx;
68
+}
69
+.address .right .icon {
70
+  width: 100%;
71
+  height: 100%;
72
+}
73
+.address .right .arrow {
74
+  width: 32rpx;
75
+  height: 32rpx;
76
+  box-sizing: border-box;
77
+  border-top: 2px solid #3e3e3e;
78
+  border-right: 2px solid #3e3e3e;
79
+  transform: rotate(45deg);
80
+}
81
+.address-hover {
82
+  background-color: #d9d9d9;
83
+}
84
+.authorization {
85
+  justify-content: center;
86
+}
87
+.authorization text {
88
+  margin-left: 4rpx;
89
+  font-size: 14pt;
90
+  color: #09bb07;
91
+}
92
+.authorization .plus {
93
+  position: relative;
94
+  width: 32rpx;
95
+  height: 32rpx;
96
+}
97
+.authorization .plus::before {
98
+  position: absolute;
99
+  top: calc(50% - 6rpx / 2);
100
+  left: 0;
101
+  width: 100%;
102
+  height: 6rpx;
103
+  content: '';
104
+  background-color: #09bb07;
105
+  border-radius: 6rpx;
106
+}
107
+.authorization .plus::after {
108
+  position: absolute;
109
+  top: 0;
110
+  left: calc(50% - 6rpx / 2);
111
+  width: 6rpx;
112
+  height: 100%;
113
+  content: '';
114
+  background-color: #09bb07;
115
+  border-radius: 6rpx;
116
+}
117
+.goods {
118
+  display: flex;
119
+  align-items: center;
120
+  width: 702rpx;
121
+  min-height: 200rpx;
122
+  margin-top: 12rpx;
123
+  background-color: #fff;
124
+  border-radius: 5px;
125
+}
126
+.goods .left {
127
+  display: flex;
128
+  align-items: center;
129
+  justify-content: center;
130
+  width: 200rpx;
131
+  height: 200rpx;
132
+}
133
+.goods .left image {
134
+  width: 160rpx;
135
+  height: 160rpx;
136
+  border-radius: 5px;
137
+}
138
+.goods .right {
139
+  display: flex;
140
+  flex-direction: column;
141
+  justify-content: space-between;
142
+  width: 502rpx;
143
+  min-height: 160rpx;
144
+  margin: 12rpx 0;
145
+}
146
+.goods .right .top {
147
+  display: flex;
148
+  flex-direction: column;
149
+  width: 100%;
150
+}
151
+.goods .right .top .title {
152
+  font-size: 14pt;
153
+}
154
+.goods .right .top .inventory {
155
+  font-size: 10pt;
156
+  color: #959595;
157
+}
158
+.goods .right .bottom {
159
+  display: flex;
160
+  align-items: center;
161
+  box-sizing: border-box;
162
+  justify-content: space-between;
163
+  width: 100%;
164
+  padding-right: 12rpx;
165
+}
166
+.goods .right .bottom .price-group {
167
+  display: flex;
168
+  align-items: center;
169
+}
170
+.goods .right .bottom .price-group .price1 {
171
+  display: flex;
172
+  align-items: flex-end;
173
+}
174
+.goods .right .bottom .price-group .price1 text {
175
+  color: #3e3e3e;
176
+}
177
+.goods .right .bottom .price-group .price1 .value {
178
+  font-size: 13pt;
179
+}
180
+.goods .right .bottom .price-group .price1 .symbol {
181
+  margin-bottom: 2px;
182
+  font-size: 10pt;
183
+}
184
+.goods .right .bottom .price-group .price2 {
185
+  display: flex;
186
+  align-items: flex-end;
187
+  margin-left: 12rpx;
188
+}
189
+.goods .right .bottom .price-group .price2 text {
190
+  color: #959595;
191
+}
192
+.goods .right .bottom .price-group .price2 .value {
193
+  font-size: 11pt;
194
+  text-decoration: line-through;
195
+}
196
+.btn-footer {
197
+  display: flex;
198
+  align-items: center;
199
+  position: fixed;
200
+  bottom: 0;
201
+  box-sizing: border-box;
202
+  justify-content: center;
203
+  width: 100%;
204
+  height: 160rpx;
205
+  padding: 24rpx;
206
+  background-color: #fff;
207
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
208
+}
209
+.btn-footer .btn-footer-container {
210
+  display: flex;
211
+  width: 100%;
212
+  height: 100rpx;
213
+  overflow: hidden;
214
+  border: 1px #09bb07 solid;
215
+  border-radius: 5px;
216
+}
217
+.btn-footer .btn-footer-container-disabled {
218
+  border: 1px #959595 solid !important;
219
+}
220
+.btn-footer .btn-footer-container .left {
221
+  display: flex;
222
+  align-items: center;
223
+  justify-content: center;
224
+  width: 40%;
225
+  height: 100rpx;
226
+  background-color: #fff;
227
+}
228
+.btn-footer .btn-footer-container .left text {
229
+  font-size: 14pt;
230
+  font-weight: 700;
231
+  color: #e64340;
232
+}
233
+.btn-footer .btn-footer-container .right {
234
+  width: 100%;
235
+  height: 100%;
236
+}

+ 3 - 3
src/pages/order/order.wxss

@@ -9,10 +9,10 @@
9 9
   background-color: #efefef;
10 10
 }
11 11
 .order-view text {
12
-  color: #000;
12
+  color: #111;
13 13
 }
14 14
 .order-view view {
15
-  color: #000;
15
+  color: #111;
16 16
 }
17 17
 .address {
18 18
   display: flex;
@@ -169,7 +169,7 @@
169 169
   height: 160rpx;
170 170
   padding: 24rpx;
171 171
   background-color: #fff;
172
-  box-shadow: 0 -5px 9px 2px rgba(0, 0, 0, 0.1);
172
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
173 173
 }
174 174
 .btn-footer .btn-footer-container {
175 175
   display: flex;

+ 5 - 5
src/project.config.json

@@ -58,16 +58,16 @@
58 58
 			"list": [
59 59
 				{
60 60
 					"id": 0,
61
-					"name": "pages/cameraCompatible/cameraCompatible",
62
-					"pathName": "pages/cameraCompatible/cameraCompatible",
63
-					"query": "activity_id=nBJ56hN9ik94js4duSh34V&isSignIn=1",
64
-					"scene": 1047
61
+					"name": "pages/live/order/order",
62
+					"pathName": "pages/live/order/order",
63
+					"query": "room_id=24&share_openid='ccc'&goods_id=nHUqwuwaygHpos4hiekz7f",
64
+					"scene": 1007
65 65
 				},
66 66
 				{
67 67
 					"id": 1,
68 68
 					"name": "pages/index/index",
69 69
 					"pathName": "pages/index/index",
70
-					"query": "q=http://kodo.tamron.cn/v/0+21+KUjsUKURRRRRRUK6KxxK",
70
+					"query": "room_id=17",
71 71
 					"scene": 1011
72 72
 				},
73 73
 				{

+ 1 - 1
src/style/less/variable.less

@@ -1,7 +1,7 @@
1 1
 //color
2 2
 @color-bg: #efefef;
3 3
 @color-dark-bg: #3e3e3e;
4
-@color-black: #000;
4
+@color-black: #111;
5 5
 @color-white: #fff;
6 6
 @color-brand: #09bb07;
7 7
 @color-other1: #d2b167;

+ 2 - 2
src/template/footer/footer.wxss

@@ -38,7 +38,7 @@
38 38
   width: 100%;
39 39
   height: 160rpx;
40 40
   background-color: #fff;
41
-  box-shadow: 0 -5px 9px 2px rgba(0, 0, 0, 0.1);
41
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
42 42
 }
43 43
 .btn-footer1 button {
44 44
   height: 100rpx;
@@ -55,7 +55,7 @@
55 55
   width: 100%;
56 56
   height: 160rpx;
57 57
   background-color: #fff;
58
-  box-shadow: 0 -5px 9px 2px rgba(0, 0, 0, 0.1);
58
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
59 59
 }
60 60
 .btn-footer2 button {
61 61
   height: 100rpx;

+ 2 - 26
src/template/resultView/resultView.js

@@ -13,32 +13,8 @@ Page({
13 13
     isHightlight: false
14 14
   },
15 15
 
16
-  onLoad(options) {
17
-    if (options.goods) {
18
-      const goods = JSON.parse(options.goods)
19
-      let desc = this.data.desc1
20
-      if (goods.only_for_member) {
21
-        desc = this.data.desc3
22
-      } else if (goods.good_type === 0) {
23
-        desc = this.data.desc2
24
-      }
25
-      this.setData({
26
-        isVirtual: goods.good_type === 1,
27
-        desc
28
-      })
29
-    } else {
30
-      const eventChannel = this.getOpenerEventChannel()
31
-      const that = this
32
-      eventChannel.on('acceptDataFromOpenerPage', data => {
33
-        that.setData({
34
-          title: data.title,
35
-          desc: data.desc,
36
-          action: 'navigateToMine',
37
-          btnTitle: data.btnTitle,
38
-          isHightlight: data.isHightlight
39
-        })
40
-      })
41
-    }
16
+  onLoad() {
17
+    wx.hideHomeButton()
42 18
   },
43 19
 
44 20
   navigateToMine() {

+ 7 - 10
src/template/resultView/resultView.wxml

@@ -1,24 +1,21 @@
1 1
 
2
-<view class="result-view" wx:if="{{isHightlight}}">
2
+<view class="result-view">
3 3
   <view class="logo">
4 4
     <image src="success.svg"></image>
5 5
   </view>
6 6
   <view class="content">
7
-    <text class="title">{{ title }}</text>
8
-    <view class="hint">
7
+    <text class="title">购买成功</text>
8
+    <!-- <view class="hint">
9 9
       <image src="/resources/trumpet.svg"></image>
10
-      <text>{{ desc }}</text>
11
-    </view>
10
+      <text>七天内发货</text>
11
+    </view> -->
12 12
     <view class="official-account">
13 13
       <official-account binderror="officialAccountError"></official-account>
14 14
     </view>
15 15
   </view>
16
-  <view class="action-bottom">
17
-    <view class="goOn" bindtap="{{ action }}">{{ btnTitle }}</view>
18
-  </view>
19 16
 </view>
20 17
 
21
-<view class="result-view" wx:else>
18
+<!-- <view class="result-view" wx:else>
22 19
   <view class="logo">
23 20
     <image src="success.svg"></image>
24 21
   </view>
@@ -30,4 +27,4 @@
30 27
     <view class="goOn" bindtap="{{ action }}">{{ btnTitle }}</view>
31 28
     <view class="detail" bindtap="navigateToVoucher" wx:if="{{ isVirtual }}">去查看</view>
32 29
   </view>
33
-</view>
30
+</view> -->

+ 1 - 1
src/template/resultView/resultView.wxss

@@ -28,7 +28,7 @@
28 28
   margin-top: 24rpx;
29 29
   font-size: 17pt;
30 30
   font-weight: 600;
31
-  color: #000;
31
+  color: #111;
32 32
 }
33 33
 .content .desc {
34 34
   margin-top: 24rpx;

+ 47 - 1
src/utils/network.js

@@ -149,7 +149,53 @@ function post(params, isTip = true) {
149 149
   })
150 150
 }
151 151
 
152
+function liveLogin(data) {
153
+  const params = data
154
+  wx.showLoading({
155
+    title: '加载中...',
156
+    mask: true
157
+  })
158
+  wx.login({
159
+    success(res1) {
160
+      if (res1.code) {
161
+        params.code = res1.code
162
+        wx.request({
163
+          url: urls.LIVE.LOGIN,
164
+          data: params,
165
+          method: 'POST',
166
+          header: {
167
+            'content-type': 'application/x-www-form-urlencoded'
168
+          },
169
+          success(res2) {
170
+            wx.setStorage({
171
+              key: 'userInfo',
172
+              data: res2.data.data
173
+            })
174
+          },
175
+          complete: () => {
176
+            wx.hideLoading()
177
+          }
178
+        })
179
+      } else {
180
+        wx.showToast({
181
+          title: '微信登录异常',
182
+          icon: 'none'
183
+        })
184
+        wx.hideLoading()
185
+      }
186
+    },
187
+    fail() {
188
+      wx.showToast({
189
+        title: '微信登录异常',
190
+        icon: 'none'
191
+      })
192
+      wx.hideLoading()
193
+    }
194
+  })
195
+}
196
+
152 197
 module.exports = {
153 198
   post,
154
-  login
199
+  login,
200
+  liveLogin
155 201
 }

+ 9 - 1
src/utils/urls.js

@@ -7,5 +7,13 @@ module.exports = {
7 7
 
8 8
   PACK: `${config.baseURL}/api/pack`,
9 9
   ORDER_CREATE: `${config.baseURL}/api/pay/wx/order_create`,
10
-  ORDER_CANCEL: `${config.baseURL}/api/pay/wx/order/cancel`
10
+  ORDER_CANCEL: `${config.baseURL}/api/pay/wx/order/cancel`,
11
+
12
+  LIVE: {
13
+    GOODS_DETAIL: `${config.baseURL}/api/live/goods/detail`,
14
+    ORDER_CREATE: `${config.baseURL}/api/live/order/create`,
15
+    ORDER_CANCEL: `${config.baseURL}/api/live/order/cancel`,
16
+    ROOM_ANCHOR: `${config.baseURL}/api/live/room/anchor/detail`,
17
+    LOGIN: `${config.baseURL}/api/mini/live/login`
18
+  }
11 19
 }

Kodo/kodo - Gogs: Go Git Service

46 Commity (0786f22bad384666d71837506f87248444f6abbf)

Autor SHA1 Wiadomość Data
  Brightcells 0786f22bad order_by('-pk') replace of order_by('-created_at') 10 lat temu
  Brightcells 62ef679981 add ret photo_url and photo_thumbnail_url 10 lat temu
  Brightcells d3088e1fec add ret msg_type_desc 10 lat temu
  Brightcells 464c31b794 support POST method for message relative api 10 lat temu
  Brightcells 8f83bd22be add param user_id for msg relative api 10 lat temu
  Brightcells 928a51477c 'UserMessageInfo' object has no attribute 'title' 10 lat temu
  Brightcells 8f14561134 UserMessageInfo in admin.py 10 lat temu
  Brightcells 89094aa77b if user exists, update user info, in api wx_authorize_api 10 lat temu
  Brightcells ba7bc03f03 adjust sex value 10 lat temu
  Brightcells 30daca135b add api message_list_api/message_type_list_api/message_read_api 10 lat temu
  Brightcells 03561aaa5f modify api comment_submit_api/comment_list_api 10 lat temu
  Brightcells c72d89f6e5 add api comment_submit_api/comment_list_api/thumbup_submit_api/thumbup_list_api/thumbup_cancel_api 10 lat temu
  Brightcells df1df69fe3 add api upgrade/splash 10 lat temu
  Brightcells 3253626936 change DOMAIN and IMG_DOMAIN to pai.ai 10 lat temu
  Brightcells e5721d434c add URL_CONFIG for domain pai.ai 10 lat temu
  Brightcells 2b831a139f CONN_MAX_AGE & cached.Loader 10 lat temu
  Brightcells 2fb52216da Fix Bug: wx authorize doesn't store wx_uid 10 lat temu
  Brightcells 48d2e93b70 return nickname for userinfo data 11 lat temu
  Brightcells 814ed79bfc add api group_unlock_api 11 lat temu
  Brightcells 1c25788dbf add group_name for group_create_api 11 lat temu
  Brightcells 8b5ea74192 add location /fly 11 lat temu
  Brightcells 4afdb94e20 add avatar for GroupUserInfo 11 lat temu
  Brightcells 5ef425fee7 add api wx_authorize_api 11 lat temu
  Brightcells d3798a39f1 update session_detail_api 11 lat temu
  Brightcells ce10db91f9 thumbnail_utils make_thumb 11 lat temu
  Brightcells f587f0a48f user can just see photo after he joined the group & zh_Hans replace zh_CN in settings.py 11 lat temu
  Brightcells 42df840f43 return current_id for api flyimg_upload/flyimg_list 11 lat temu
  Brightcells 9077a53317 return next_id for api flyimg_upload/flyimg_list 11 lat temu
  Brightcells f58bde298b add api flyimg_upload/flyimg_list 11 lat temu
  Brightcells 7fd74ed1e4 add group_join_api direct pass 11 lat temu
  Brightcells 7467a3e68a add api group_update/group_remove 11 lat temu
  Brightcells 7e305483ab add api group_detail/group_lock/group_pass/group_refuse 11 lat temu
  Brightcells e184e7dd5b add api group_create/group_join 11 lat temu
  Brightcells 6e77deb909 https://pypi.python.org/pypi/django-curtail-uuid 11 lat temu
  Brightcells e7d461ade5 upload photo with photo_id 11 lat temu
  Brightcells ca16dc830e alias .img.xfoto.com.cn/photo 11 lat temu
  Brightcells 7ddb9f0b5e change to use img.xfoto.com.cn as photo domain 11 lat temu
  Brightcells 3454610bb7 add api of user signup/login 11 lat temu
  Brightcells 00e8234de9 add api photo_standard_api 11 lat temu
  Brightcells e0ba30f506 add api session_detail_api 11 lat temu
  Brightcells 4a8b4f8819 add watermark 11 lat temu
  Brightcells b9c2997666 change server name .api.xfoto.com.cn before .xfoto.com.cn 11 lat temu
  Brightcells ca8b65a77e nginx conf & requirements 11 lat temu
  Brightcells 434468279f add api of lesman login & update other api 11 lat temu
  Brightcells 52ce35cbfc add api uuid_init/uuid 11 lat temu
  Brightcells 4defb80fdc gogs first init 11 lat temu