support live

FFIB 5 anni fa
parent
commit
c747f7df0f

+ 33 - 1
src/app.js

@@ -4,6 +4,8 @@ const brandConfig = require('./brand/config.js')
4 4
 const router = require('./utils/router.js')
5 5
 const routerInterceptor = require('./utils/routerInterceptor')
6 6
 
7
+const livePlayer = requirePlugin('live-player-plugin')
8
+
7 9
 App({
8 10
   copywriting: brandConfig.copywriting,
9 11
   brandConfig,
@@ -24,7 +26,12 @@ App({
24 26
       '金卡会员',
25 27
       '白金卡会员',
26 28
       '黑金卡会员'
27
-    ]
29
+    ],
30
+    liveData: {
31
+      roomid: '',
32
+      openid: '',
33
+      share_openid: ''
34
+    }
28 35
   },
29 36
 
30 37
   sceneHandler: null,
@@ -32,6 +39,31 @@ App({
32 39
   onLaunch() {},
33 40
 
34 41
   onShow(options) {
42
+    // wx.navigateTo({
43
+    //   url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=31`
44
+    // })
45
+    if (
46
+      options.scene === 1007 ||
47
+      options.scene === 1008 ||
48
+      options.scene === 1044
49
+    ) {
50
+      livePlayer
51
+        .getShareParams()
52
+        .then(res => {
53
+          network.liveLogin({
54
+            share_openid: res.share_openid,
55
+            room_id: res.room_id
56
+          })
57
+        })
58
+        .catch(err => {
59
+          console.log('get share params', err)
60
+        })
61
+    }
62
+
63
+    network.liveLogin({
64
+      share_openid: 'test',
65
+      room_id: 1
66
+    })
35 67
     this._warrantyCardCallBack(options.referrerInfo)
36 68
   },
37 69
 

+ 5 - 5
src/app.json

@@ -3,7 +3,9 @@
3 3
     "pages/index/index",
4 4
     "pages/order/order",
5 5
     "template/webView/webView",
6
-    "template/resultView/resultView"
6
+    "template/resultView/resultView",
7
+    "pages/live/anchorHome/anchorHome",
8
+    "pages/live/order/order"
7 9
   ],
8 10
   "window": {
9 11
     "backgroundTextStyle": "dark",
@@ -22,10 +24,8 @@
22 24
   "sitemapLocation": "sitemap.json",
23 25
   "plugins": {
24 26
     "live-player-plugin": {
25
-        "version": "1.0.8",
26
-        "provider": "wx2b03c6e691cd7370"
27
+      "version": "1.0.11",
28
+      "provider": "wx2b03c6e691cd7370"
27 29
     }
28 30
   }
29
-
30
-
31 31
 }

+ 1 - 1
src/component/btnFooter-protocol/btnFooter-protocol.wxss

@@ -11,7 +11,7 @@
11 11
   width: 100%;
12 12
   height: 200rpx;
13 13
   background-color: #fff;
14
-  box-shadow: 0 -5px 9px 2px rgba(0, 0, 0, 0.1);
14
+  box-shadow: 0 -5px 9px 2px rgba(17, 17, 17, 0.1);
15 15
 }
16 16
 .btn-footer .protocol {
17 17
   display: flex;

+ 1 - 1
src/component/dialog-input/dialog-input.wxss

@@ -98,7 +98,7 @@ form .item button .placeholder {
98 98
 }
99 99
 form .item button .txt {
100 100
   font-size: 13pt;
101
-  color: #000;
101
+  color: #111;
102 102
 }
103 103
 form .item button .arrow {
104 104
   width: 14rpx;

+ 1 - 1
src/component/stepper/add.svg

@@ -1 +1 @@
1
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587110727868" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1164" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 85.333333c235.637333 0 426.666667 191.029333 426.666667 426.666667S747.637333 938.666667 512 938.666667 85.333333 747.637333 85.333333 512 276.362667 85.333333 512 85.333333z m0 234.666667a32 32 0 0 0-32 32v128H352a32 32 0 0 0 0 64h128v128a32 32 0 0 0 64 0V544h128a32 32 0 0 0 0-64H544V352a32 32 0 0 0-32-32z" p-id="1165" fill="#09bb07"></path></svg>
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1589526482488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1392" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M886.55644445 493.45422222H122.76622222c-21.84533333 0-39.59466667-17.74933333-39.59466667-39.59466667s17.74933333-39.59466667 39.59466667-39.59466666h763.79022223c21.84533333 0 39.59466667 17.74933333 39.59466666 39.59466666s-17.74933333 39.59466667-39.59466666 39.59466667z" fill="#000000" p-id="1393"></path><path d="M504.71822222 985.65688889c-21.84533333 0-39.59466667-17.74933333-39.59466667-39.59466667V97.50755555c0-21.84533333 17.74933333-39.59466667 39.59466667-39.59466666 21.84533333 0 39.59466667 17.74933333 39.59466667 39.59466666v848.66844445c0 21.73155555-17.74933333 39.48088889-39.59466667 39.48088889z" fill="#000000" p-id="1394"></path></svg>

+ 0 - 1
src/component/stepper/minus.svg

@@ -1 +0,0 @@
1
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1587110843176" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1962" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M510.293333 126.862222c51.863704 0 102.115556 10.145185 149.428148 30.151111 45.700741 19.342222 86.755556 47.028148 122.026667 82.29926 35.271111 35.271111 62.957037 76.325926 82.299259 122.026666 20.005926 47.312593 30.151111 97.564444 30.151112 149.428148s-10.145185 102.115556-30.151112 149.428149c-19.342222 45.700741-47.028148 86.755556-82.299259 122.026666-35.271111 35.271111-76.325926 62.957037-122.026667 82.299259-47.217778 20.100741-97.564444 30.340741-149.428148 30.340741S408.177778 884.622222 360.865185 864.616296c-45.700741-19.342222-86.755556-47.028148-122.026666-82.299259-35.271111-35.271111-62.957037-76.325926-82.29926-122.026667-20.005926-47.312593-30.151111-97.564444-30.151111-149.428148S136.533333 408.651852 156.539259 361.339259c19.342222-45.700741 47.028148-86.755556 82.29926-122.026666 35.271111-35.271111 76.325926-62.957037 122.026666-82.29926 47.312593-20.005926 97.659259-30.151111 149.428148-30.151111m0-42.666666c-235.614815 0-426.666667 191.051852-426.666666 426.666666s191.051852 426.666667 426.666666 426.666667 426.666667-191.051852 426.666667-426.666667-190.957037-426.666667-426.666667-426.666666z" p-id="1963" fill="#09bb07"></path><path d="M709.499259 532.195556h-398.222222c-11.757037 0-21.333333-9.576296-21.333333-21.333334s9.576296-21.333333 21.333333-21.333333h398.222222c11.757037 0 21.333333 9.576296 21.333334 21.333333s-9.576296 21.333333-21.333334 21.333334z" p-id="1964" fill="#09bb07"></path></svg>

+ 1 - 0
src/component/stepper/minus1.svg

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1589526487914" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1587" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M883.59822222 551.70844445H118.10133333c-23.43822222 0-42.55288889-19.00088889-42.55288888-42.5528889s19.00088889-42.55288889 42.55288888-42.55288888h765.49688889c23.43822222 0 42.55288889 19.00088889 42.55288889 42.55288888s-19.00088889 42.55288889-42.55288889 42.5528889z" fill="#aaaaaa" p-id="1588"></path></svg>

+ 1 - 0
src/component/stepper/minus2.svg

@@ -0,0 +1 @@
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1589526487914" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1587" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M883.59822222 551.70844445H118.10133333c-23.43822222 0-42.55288889-19.00088889-42.55288888-42.5528889s19.00088889-42.55288889 42.55288888-42.55288888h765.49688889c23.43822222 0 42.55288889 19.00088889 42.55288889 42.55288888s-19.00088889 42.55288889-42.55288889 42.5528889z" fill="#000000" p-id="1588"></path></svg>

+ 8 - 2
src/component/stepper/stepper.js

@@ -1,9 +1,8 @@
1 1
 // component/stepper/stepper.js
2 2
 Component({
3 3
   data: {
4
-    num: 0
4
+    num: 1
5 5
   },
6
-
7 6
   /**
8 7
    * 组件的方法列表
9 8
    */
@@ -17,6 +16,13 @@ Component({
17 16
     },
18 17
 
19 18
     bindminus() {
19
+      if (this.data.num === 1) {
20
+        wx.showToast({
21
+          title: '数量至少为1',
22
+          icon: 'none'
23
+        })
24
+        return
25
+      }
20 26
       this.setData({
21 27
         num: this.data.num - 1
22 28
       })

+ 16 - 3
src/component/stepper/stepper.less

@@ -1,16 +1,29 @@
1 1
 @import './src/style/less/variable.less';
2
+@import './src/style/less/layout.less';
2 3
 
3 4
 .stepper {
4 5
   display: flex;
5 6
   align-items: center;
7
+  justify-content: center;
6 8
 
7 9
   .icon {
8
-    width: 72rpx;
9
-    height: 72rpx;
10
+    .flex-center(row);
11
+
12
+    justify-content: center;
13
+    width: 48rpx;
14
+    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
 }