Commit e8c00a5c9111f36bb293ba9c6607086940b09d77
Merge branch 'dev' into 'test'
Dev See merge request !458
Showing
51 changed files
with
1920 additions
and
214 deletions
app.js
| ... | ... | @@ -11,6 +11,7 @@ App({ |
| 11 | 11 | //使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。 |
| 12 | 12 | var custum_data=this.globalData.custum_data; |
| 13 | 13 | var isIpx=this.globalData.isIpx; |
| 14 | + var is_read=this.globalData.is_read; | |
| 14 | 15 | //var curPageArr = getCurrentPages(); //获取加载的页面 |
| 15 | 16 | //var curPage = curPageArr[curPageArr.length - 1]; //获取当前页面的对象 |
| 16 | 17 | var curPage=th; |
| ... | ... | @@ -18,7 +19,7 @@ App({ |
| 18 | 19 | if (pagePath.indexOf('/') != 0) { |
| 19 | 20 | pagePath = '/' + pagePath; |
| 20 | 21 | } |
| 21 | - if(isIpx){ | |
| 22 | + if(is_read){ | |
| 22 | 23 | if(custum_data){ |
| 23 | 24 | that.set_custom_nav(custum_data,isIpx,pagePath,url,curPage); |
| 24 | 25 | }else{ |
| ... | ... | @@ -49,10 +50,32 @@ App({ |
| 49 | 50 | that.globalData.isIpx=isIpx; |
| 50 | 51 | getApp().request.promiseGet("/api/weshop/storeFooter/get/"+stoid, { |
| 51 | 52 | }).then(res => { |
| 53 | + this.globalData.is_read=true; | |
| 52 | 54 | var e = res; |
| 53 | 55 | if(e.data.code != -1){ |
| 54 | 56 | that.globalData.custum_data=e.data.data; |
| 55 | - that.set_custom_nav(e.data.data,isIpx,pagePath,url,curPage); | |
| 57 | + | |
| 58 | + var itemList = that.globalData.custum_data.data; | |
| 59 | + itemList = JSON.parse(itemList) | |
| 60 | + | |
| 61 | + if(!itemList[0].weappurl){ | |
| 62 | + that.globalData.custum_data=null; | |
| 63 | + var tabBar = { | |
| 64 | + 'iscustom':2, | |
| 65 | + 'url':url, | |
| 66 | + 'active':pagePath, | |
| 67 | + 'isIpx':isIpx, | |
| 68 | + cartGoodsNum:this.globalData.cartGoodsNum | |
| 69 | + } | |
| 70 | + curPage.setData({ | |
| 71 | + tabBar:tabBar, | |
| 72 | + isIpx:isIpx, | |
| 73 | + cartGoodsNum:this.globalData.cartGoodsNum | |
| 74 | + }) | |
| 75 | + }else{ | |
| 76 | + that.set_custom_nav(e.data.data,isIpx,pagePath,url,curPage); | |
| 77 | + } | |
| 78 | + | |
| 56 | 79 | }else{ |
| 57 | 80 | var tabBar = { |
| 58 | 81 | 'iscustom':2, |
| ... | ... | @@ -136,7 +159,10 @@ App({ |
| 136 | 159 | first_leader:null, //分享会员ID |
| 137 | 160 | guide_id:null, //分享导购ID |
| 138 | 161 | |
| 139 | - windowWidth:0, //整个窗体的宽度 | |
| 162 | + windowWidth:0, //整个窗体的宽度 | |
| 163 | + | |
| 164 | + room_id:null, //直播间分享的房间ID | |
| 165 | + room_goods_id:null, //直播间分享的商品ID | |
| 140 | 166 | |
| 141 | 167 | }, |
| 142 | 168 | auth: o, |
| ... | ... | @@ -563,9 +589,11 @@ App({ |
| 563 | 589 | //清空登录时候缓存的值 |
| 564 | 590 | onHide:function () { |
| 565 | 591 | this.globalData.is_test=0; |
| 566 | - this.globalData.guide_id=null; //导购清空 | |
| 567 | - this.globalData.first_leader=null; //分享的会员清空 | |
| 568 | - th.globalData.wuliu=null; //关闭要把物流清空 | |
| 592 | + this.globalData.guide_id=null; //导购清空 | |
| 593 | + this.globalData.first_leader=null; //分享的会员清空 | |
| 594 | + this.globalData.wuliu=null; //关闭要把物流清空 | |
| 595 | + this.globalData.room_id=null; //关闭要把房间号关闭 | |
| 596 | + this.globalData.room_goods_id=null; //关闭要把物流清空 | |
| 569 | 597 | } |
| 570 | 598 | |
| 571 | 599 | ... | ... |
app.json
| 1 | 1 | { |
| 2 | 2 | "pages": [ |
| 3 | 3 | "pages/index/index/index", |
| 4 | + "pages/justTest/justTest", | |
| 4 | 5 | "pages/goods/categoryList/categoryList", |
| 5 | 6 | "pages/cart/cart/cart", |
| 6 | 7 | "pages/cart/cart2/cart2", |
| ... | ... | @@ -85,16 +86,17 @@ |
| 85 | 86 | "pages/video/index", |
| 86 | 87 | "pages/template/index", |
| 87 | 88 | "pages/store/index" |
| 88 | - | |
| 89 | 89 | ], |
| 90 | 90 | |
| 91 | 91 | "subPackages": [{ |
| 92 | 92 | "root": "packageA/", |
| 93 | 93 | "name":"pack1", |
| 94 | 94 | "pages": [ |
| 95 | + "pages/liveStream/liveStream", | |
| 95 | 96 | "pages/prom_list/prom_list", |
| 96 | 97 | "pages/quan_list/quan_list", |
| 97 | - "pages/quan_pro/quan_pro" | |
| 98 | + "pages/quan_pro/quan_pro", | |
| 99 | + "pages/liveStreamDetails/liveStreamDetails" | |
| 98 | 100 | ], |
| 99 | 101 | "plugins": { |
| 100 | 102 | "live-player-plugin": { | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxml
| ... | ... | @@ -149,7 +149,7 @@ |
| 149 | 149 | <image class='zs_t_img_2l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" |
| 150 | 150 | binderror="bind_bnerr3"></image> |
| 151 | 151 | <block wx:if="{{object.goodicon==3}}"> |
| 152 | - <image class='{{g_filter.get_class(object.column,object.position)}}' wx:if="{{object.position==1}}" | |
| 152 | + <image class='{{g_filter.get_class(object.column,object.position)}}' | |
| 153 | 153 | src='{{object.customicon}}'></image> |
| 154 | 154 | </block> |
| 155 | 155 | <block wx:if="{{object.goodicon==1}}"> |
| ... | ... | @@ -285,7 +285,7 @@ |
| 285 | 285 | <image class='zs_t_img_3l' src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" |
| 286 | 286 | binderror="bind_bnerr3"></image> |
| 287 | 287 | <block wx:if="{{object.goodicon==3}}"> |
| 288 | - <image class='{{g_filter.get_class(object.column,object.position)}}' wx:if="{{ object.position==1}}" | |
| 288 | + <image class='{{g_filter.get_class(object.column,object.position)}}' | |
| 289 | 289 | src='{{object.customicon}}'></image> |
| 290 | 290 | </block> |
| 291 | 291 | <block wx:if="{{object.goodicon==1}}"> |
| ... | ... | @@ -422,7 +422,7 @@ |
| 422 | 422 | </block> |
| 423 | 423 | |
| 424 | 424 | <block wx:if="{{object.goodicon==3}}"> |
| 425 | - <image class='{{g_filter.get_class(object.column,object.position)}}' wx:if="{{object.position==2}}" | |
| 425 | + <image class='{{g_filter.get_class(object.column,object.position)}}' | |
| 426 | 426 | src='{{object.customicon}}'></image> |
| 427 | 427 | </block> |
| 428 | 428 | <block wx:if="{{object.goodicon==1}}"> | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
| ... | ... | @@ -145,6 +145,7 @@ |
| 145 | 145 | height: 318rpx; |
| 146 | 146 | margin-top: 20rpx; |
| 147 | 147 | display: flex; |
| 148 | + position: relative; | |
| 148 | 149 | } |
| 149 | 150 | |
| 150 | 151 | .zs_t_img_x { |
| ... | ... | @@ -236,7 +237,7 @@ |
| 236 | 237 | height: 56rpx; |
| 237 | 238 | position: relative; |
| 238 | 239 | right: 56rpx; |
| 239 | - top: 234rpx; | |
| 240 | + top: 0rpx; | |
| 240 | 241 | } |
| 241 | 242 | |
| 242 | 243 | .zs_t1_x3 { |
| ... | ... | @@ -473,6 +474,13 @@ |
| 473 | 474 | left: 0rpx; |
| 474 | 475 | top: 10rpx; |
| 475 | 476 | } |
| 477 | +.zs_t1_x4{ | |
| 478 | + width: 56rpx; | |
| 479 | + height: 56rpx; | |
| 480 | + position: absolute; | |
| 481 | + right: 0rpx; | |
| 482 | + bottom: 10rpx; | |
| 483 | +} | |
| 476 | 484 | |
| 477 | 485 | .zs_t2_3l { |
| 478 | 486 | width: 56rpx; |
| ... | ... | @@ -562,3 +570,5 @@ |
| 562 | 570 | overflow: hidden; |
| 563 | 571 | white-space: nowrap; |
| 564 | 572 | } |
| 573 | + | |
| 574 | + | ... | ... |
components/diy_picMax/diy_picMax.wxss
| 1 | 1 | .picMax{width: 100%;position: relative;} |
| 2 | 2 | .pic_item{display: block; top:0;left:0;float:left} |
| 3 | -.pic_item image{width: 100%; height: 100%} | |
| 4 | -.width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:748rpx;} | |
| 3 | +.pic_item image{width: 100%; height: 100%; vertical-align: bottom;} | |
| 4 | +.width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:750rpx;} | |
| 5 | 5 | /* .height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;} */ |
| 6 | 6 | /* .mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;} |
| 7 | 7 | .mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;} */ | ... | ... |
packageA/images/index/tuangou-pic.jpg
0 → 100644
25 KB
packageA/images/liveStreamDetails/circle.jpg
0 → 100644
3.83 KB
packageA/images/liveStreamDetails/cover.jpg
0 → 100644
88.7 KB
packageA/images/liveStreamDetails/friend.jpg
0 → 100644
4.38 KB
packageA/images/liveStreamDetails/goods.jpg
0 → 100644
7.99 KB
packageA/images/liveStreamDetails/home.jpg
0 → 100644
1.38 KB
packageA/images/liveStreamDetails/playbill.jpg
0 → 100644
96.2 KB
packageA/images/liveStreamDetails/save.jpg
0 → 100644
968 Bytes
packageA/images/liveStreamDetails/share.jpg
0 → 100644
1.09 KB
packageA/pages/liveStream/liveStream.js
0 → 100644
| 1 | +// pages/liveStream/liveStream.js | |
| 2 | + | |
| 3 | +var t = require("../../../utils/util"), | |
| 4 | + ut = t, | |
| 5 | + e = require("../../../utils/common.js"), | |
| 6 | + a = require("../../../utils/wxParse/wxParse.js"), | |
| 7 | + s = getApp(), | |
| 8 | + i = s.request, | |
| 9 | + rq = i, | |
| 10 | + oo = s.globalData, | |
| 11 | + o = s.globalData.setting, | |
| 12 | + os = o; | |
| 13 | +var utils = require('../../../utils/util.js'),ut=utils; | |
| 14 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
| 15 | + | |
| 16 | +Page({ | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 页面的初始数据 | |
| 20 | + */ | |
| 21 | + data: { | |
| 22 | + goodsList: [], | |
| 23 | + imghost: '', | |
| 24 | + liveList: {} | |
| 25 | + }, | |
| 26 | + | |
| 27 | + // 点击直播列表项 | |
| 28 | + clickItem: function (e) { | |
| 29 | + // id:列表项id | |
| 30 | + // live:直播类别 即将开始/直播中/精彩回放 | |
| 31 | + wx.navigateTo({ | |
| 32 | + url: '/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + e.currentTarget.dataset.id + '&live=' + e.currentTarget.dataset.live | |
| 33 | + }) | |
| 34 | + console.log('options-->'); | |
| 35 | + }, | |
| 36 | + | |
| 37 | + // 点击 订阅/观看直播/观看回放 按钮,跳转直播组件 | |
| 38 | + clickLive: function (e) { | |
| 39 | + console.log('当前房间号roomid:',e.currentTarget.dataset.roomid); | |
| 40 | + let roomId = e.currentTarget.dataset.roomid; | |
| 41 | + let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 })); | |
| 42 | + wx.navigateTo({ | |
| 43 | + url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${customParams}` | |
| 44 | + }) | |
| 45 | + }, | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 生命周期函数--监听页面加载 | |
| 49 | + */ | |
| 50 | + onLoad: function (options) { | |
| 51 | + var live = {}; | |
| 52 | + live.toBegin = []; // 即将开始 | |
| 53 | + live.ing = []; // 直播中 | |
| 54 | + live.over = []; // 已结束 | |
| 55 | + | |
| 56 | + // 请求数据 | |
| 57 | + var that = this; | |
| 58 | + getApp().request.promiseGet("/api/weshop/wx/livelist/page", {}).then(res=>{ | |
| 59 | + console.log('ressss--->',res); | |
| 60 | + if(res.data.code==0){ | |
| 61 | + that.setData({ | |
| 62 | + goodsList: res.data.data.pageData | |
| 63 | + }) | |
| 64 | + } | |
| 65 | + // console.log(goodsList); | |
| 66 | + | |
| 67 | + var result = res.data.data.pageData; | |
| 68 | + var liveStatus; | |
| 69 | + if(res.data.code == 0) { | |
| 70 | + for(var i in result) { | |
| 71 | + console.log(i + '当前直播状态:', result[i].live_status); | |
| 72 | + liveStatus = result[i].live_status; | |
| 73 | + // 这里只显示101/102/103状态 | |
| 74 | + if (liveStatus == '101') { | |
| 75 | + live.ing.push(result[i]); | |
| 76 | + } else if (liveStatus == '102') { | |
| 77 | + live.toBegin.push(result[i]); | |
| 78 | + } else if (liveStatus == '103') { | |
| 79 | + live.over.push(result[i]); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + // console.log('live--->', live); | |
| 83 | + that.setData({ | |
| 84 | + live | |
| 85 | + }); | |
| 86 | + } | |
| 87 | + }) | |
| 88 | + }, | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 生命周期函数--监听页面初次渲染完成 | |
| 92 | + */ | |
| 93 | + onReady: function () { | |
| 94 | + | |
| 95 | + }, | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * 生命周期函数--监听页面显示 | |
| 99 | + */ | |
| 100 | + onShow: function () { | |
| 101 | + | |
| 102 | + }, | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * 生命周期函数--监听页面隐藏 | |
| 106 | + */ | |
| 107 | + onHide: function () { | |
| 108 | + | |
| 109 | + }, | |
| 110 | + | |
| 111 | + /** | |
| 112 | + * 生命周期函数--监听页面卸载 | |
| 113 | + */ | |
| 114 | + onUnload: function () { | |
| 115 | + | |
| 116 | + }, | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * 页面相关事件处理函数--监听用户下拉动作 | |
| 120 | + */ | |
| 121 | + onPullDownRefresh: function () { | |
| 122 | + | |
| 123 | + }, | |
| 124 | + | |
| 125 | + /** | |
| 126 | + * 页面上拉触底事件的处理函数 | |
| 127 | + */ | |
| 128 | + onReachBottom: function () { | |
| 129 | + | |
| 130 | + }, | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * 用户点击右上角分享 | |
| 134 | + */ | |
| 135 | + onShareAppMessage: function () { | |
| 136 | + | |
| 137 | + } | |
| 138 | +}) | |
| 0 | 139 | \ No newline at end of file | ... | ... |
packageA/pages/liveStream/liveStream.json
0 → 100644
packageA/pages/liveStream/liveStream.wxml
0 → 100644
| 1 | +<!--pages/liveStream/liveStream.wxml--> | |
| 2 | +<wxs src="../../../utils/filter.wxs" module="filter"></wxs> | |
| 3 | +<view> | |
| 4 | + <block wx:if="{{live === '{}'}}">当前暂无直播</block> | |
| 5 | + <!-- 即将开始 --> | |
| 6 | + <block wx:if="{{live.toBegin.length > 0}}"> | |
| 7 | + <view class="title">即将开始</view> | |
| 8 | + <view class="list"> | |
| 9 | + <block wx:for="{{live.toBegin}}"> | |
| 10 | + <view class="list-item" data-id="{{item.id}}" data-live="toBegin" catchtap="clickItem"> | |
| 11 | + <view class="list-item-left"> | |
| 12 | + <image src="{{item.cover_img}}" class="item-pic" mode="aspectFill"></image> | |
| 13 | + <!-- <view class="item-desc"> | |
| 14 | + <view>{{item.name}}</view> | |
| 15 | + <view>{{filter.format_time(item.start_time)}}</view> | |
| 16 | + </view> --> | |
| 17 | + </view> | |
| 18 | + <view class="list-item-right"> | |
| 19 | + <view class="item-title">{{item.name}}</view> | |
| 20 | + <subscribe room-id="{{item.roomid}}" stopPropagation="{{true}}"></subscribe> | |
| 21 | + </view> | |
| 22 | + | |
| 23 | + </view> | |
| 24 | + | |
| 25 | + </block> | |
| 26 | + </view> | |
| 27 | + </block> | |
| 28 | + | |
| 29 | + | |
| 30 | + <!-- 直播中 --> | |
| 31 | + <block wx:if="{{live.ing.length > 0}}"> | |
| 32 | + <view class="title">直播中</view> | |
| 33 | + <view class="list"> | |
| 34 | + <block wx:for="{{live.ing}}"> | |
| 35 | + <view class="list-item" catchtap="clickItem" data-id="{{item.id}}" data-live="ing"> | |
| 36 | + <view class="list-item-left"> | |
| 37 | + <image src="{{item.cover_img}}" class="item-pic" mode="aspectFill"></image> | |
| 38 | + </view> | |
| 39 | + <view class="list-item-right"> | |
| 40 | + <view class="item-title">{{item.name}}</view> | |
| 41 | + <view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}">观看直播</view> | |
| 42 | + </view> | |
| 43 | + </view> | |
| 44 | + </block> | |
| 45 | + </view> | |
| 46 | + </block> | |
| 47 | + | |
| 48 | + | |
| 49 | + <!-- 精彩回放 --> | |
| 50 | + <block wx:if="{{live.over.length > 0}}"> | |
| 51 | + <view class="title">精彩回放</view> | |
| 52 | + <view class="list"> | |
| 53 | + <block wx:for="{{live.over}}"> | |
| 54 | + <view class="list-item" bindtap="clickItem" data-id="{{item.id}}" data-live="over"> | |
| 55 | + <view class="list-item-left"> | |
| 56 | + <image src="{{item.cover_img}}" class="item-pic" mode="aspectFill"></image> | |
| 57 | + </view> | |
| 58 | + <view class="list-item-right"> | |
| 59 | + <view class="item-title">{{item.name}}</view> | |
| 60 | + <view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}">观看回放</view> | |
| 61 | + </view> | |
| 62 | + </view> | |
| 63 | + </block> | |
| 64 | + </view> | |
| 65 | + </block> | |
| 66 | +</view> | |
| 0 | 67 | \ No newline at end of file | ... | ... |
packageA/pages/liveStream/liveStream.wxss
0 → 100644
| 1 | +/* pages/liveStream/liveStream.wxss */ | |
| 2 | +.title { | |
| 3 | + font-size: 30rpx; | |
| 4 | + padding: 50rpx 32rpx; | |
| 5 | +} | |
| 6 | +.list-item { | |
| 7 | + padding: 0 32rpx 30rpx; | |
| 8 | + display: flex; | |
| 9 | +} | |
| 10 | +.list-item-left { | |
| 11 | + position: relative; | |
| 12 | + width: 300rpx; | |
| 13 | + height: 300rpx; | |
| 14 | + flex-shrink: 0; | |
| 15 | +} | |
| 16 | +.list-item-right { | |
| 17 | + display: flex; | |
| 18 | + flex-direction: column; | |
| 19 | + justify-content: space-between; | |
| 20 | + padding-left: 32rpx; | |
| 21 | + /* position: relative; | |
| 22 | + padding-bottom: 70rpx; */ | |
| 23 | +} | |
| 24 | +.item-pic { | |
| 25 | + /* width: 400rpx; */ | |
| 26 | + width: 100%; | |
| 27 | + height: 100%; | |
| 28 | + background-color: #eee; | |
| 29 | +} | |
| 30 | +.item-desc { | |
| 31 | + position: absolute; | |
| 32 | + bottom: 0; | |
| 33 | + width: 100%; | |
| 34 | + background: black; | |
| 35 | + color: #fff; | |
| 36 | + text-align: center; | |
| 37 | + padding-bottom: 23rpx; | |
| 38 | + | |
| 39 | + background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/ | |
| 40 | + background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/ | |
| 41 | + background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/ | |
| 42 | + background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/ | |
| 43 | +} | |
| 44 | +.item-desc view:first-child { | |
| 45 | + font-size: 24rpx; | |
| 46 | + font-weight: bold; | |
| 47 | +} | |
| 48 | +.item-desc view:last-child { | |
| 49 | + font-size: 17rpx; | |
| 50 | +} | |
| 51 | +.item-title { | |
| 52 | + font-weight: bold; | |
| 53 | + font-size: 30rpx; | |
| 54 | + text-align: justify; | |
| 55 | + | |
| 56 | + display: -webkit-box; | |
| 57 | + -webkit-box-orient: vertical; | |
| 58 | + -webkit-line-clamp: 4; | |
| 59 | + overflow: hidden; | |
| 60 | +} | |
| 61 | + | |
| 62 | +.item-btn { | |
| 63 | + width: 172rpx; | |
| 64 | + height: 56rpx; | |
| 65 | + line-height: 56rpx; | |
| 66 | + background-color: #000; | |
| 67 | + color: #fff; | |
| 68 | + font-size: 28rpx; | |
| 69 | + text-align: center; | |
| 70 | +} | |
| 71 | +subscribe { | |
| 72 | + position: relative; | |
| 73 | +} | |
| 74 | +.subscribe--live-player-subscribe__btn { | |
| 75 | + width: 172rpx !important; | |
| 76 | + height: 56rpx !important; | |
| 77 | + line-height: 56rpx !important; | |
| 78 | + background-color: #000 !important; | |
| 79 | + font-size: 28rpx !important; | |
| 80 | + position: relative; | |
| 81 | + border-radius: 0 !important; | |
| 82 | + margin: 0 !important; | |
| 83 | +} | |
| 84 | +.subscribe--live-player-notSubscribe::before { | |
| 85 | + content: '订阅'; | |
| 86 | + position: absolute; | |
| 87 | + left: 0; | |
| 88 | + width: 172rpx; | |
| 89 | + height: 56rpx; | |
| 90 | + background-color: #000; | |
| 91 | + color: #fff; | |
| 92 | +} | |
| 93 | +.subscribe--live-player-hasSubscribe { | |
| 94 | + background-color: #666 !important; | |
| 95 | +} | |
| 0 | 96 | \ No newline at end of file | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.js
0 → 100644
| 1 | +// pages/liveStreamDetails/liveStreamDetails.js | |
| 2 | +var t = require("../../../utils/util.js"), | |
| 3 | + ut = t, | |
| 4 | + e = require("../../../utils/common.js"), | |
| 5 | + a = require("../../../utils/wxParse/wxParse.js"), | |
| 6 | + s = getApp(), | |
| 7 | + i = s.request, | |
| 8 | + rq = i, | |
| 9 | + oo = s.globalData, | |
| 10 | + o = s.globalData.setting, | |
| 11 | + os = o; | |
| 12 | + | |
| 13 | +const app = getApp(); | |
| 14 | + | |
| 15 | +Page({ | |
| 16 | + /** | |
| 17 | + * 页面的初始数据 | |
| 18 | + */ | |
| 19 | + data: { | |
| 20 | + details: {}, | |
| 21 | + status: '', | |
| 22 | + btnText: '', | |
| 23 | + showActionSheet: true, | |
| 24 | + showPlaybill: true, | |
| 25 | + windowWidth: 0, | |
| 26 | + windowHeight: 0, | |
| 27 | + dpr: 0, | |
| 28 | + canvasScale: 1.0, | |
| 29 | + nickName: '', | |
| 30 | + avatarUrl: '', | |
| 31 | + coverImg: '', | |
| 32 | + canvasToImgPath: '' | |
| 33 | + }, | |
| 34 | + | |
| 35 | + // 点击商品 | |
| 36 | + clickgoods: function (e) { | |
| 37 | + console.log('...........>', e.currentTarget.dataset.url); | |
| 38 | + wx.navigateTo({ | |
| 39 | + url: '../../../' + e.currentTarget.dataset.url | |
| 40 | + }); | |
| 41 | + }, | |
| 42 | + | |
| 43 | + // 返回首页 | |
| 44 | + backHome: function () { | |
| 45 | + wx.reLaunch({ | |
| 46 | + url: '../../../pages/index/index/index', | |
| 47 | + }) | |
| 48 | + }, | |
| 49 | + | |
| 50 | + // 分享操作表 | |
| 51 | + clickShare: function () { | |
| 52 | + this.setData({ | |
| 53 | + showActionSheet: !this.data.showActionSheet | |
| 54 | + }) | |
| 55 | + }, | |
| 56 | + | |
| 57 | + // actionSheet - 取消按钮 | |
| 58 | + hiddenActionSheet: function () { | |
| 59 | + this.setData({ | |
| 60 | + showActionSheet: 'false' | |
| 61 | + }) | |
| 62 | + }, | |
| 63 | + | |
| 64 | + //生成海报 | |
| 65 | + createPlaybill: function () { | |
| 66 | + // 1.提示 “正在生成海报...” | |
| 67 | + wx.showLoading({ | |
| 68 | + title: '正在生成海报...' | |
| 69 | + }); | |
| 70 | + // 2.生成海报,如果生成完毕,关闭提示 | |
| 71 | + this.drawPlaybill(); | |
| 72 | + // 3.展示生成的海报 | |
| 73 | + this.setData({ | |
| 74 | + showPlaybill: !this.data.showPlaybill, | |
| 75 | + showActionSheet: 'false' | |
| 76 | + }); | |
| 77 | + }, | |
| 78 | + | |
| 79 | + // 获取设备信息 | |
| 80 | + getSystemInfo: function() { | |
| 81 | + let that = this; | |
| 82 | + wx.getSystemInfo({ | |
| 83 | + success: function(res) { | |
| 84 | + that.setData({ | |
| 85 | + windowWidth: res.windowWidth, | |
| 86 | + windowHeight: res.windowHeight, | |
| 87 | + dpr: res.pixelRatio | |
| 88 | + }) | |
| 89 | + } | |
| 90 | + }); | |
| 91 | + }, | |
| 92 | + | |
| 93 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 94 | + drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { | |
| 95 | + var lineWidth = 0; | |
| 96 | + var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | |
| 97 | + var han = 0; | |
| 98 | + for (let i = 0; i < str.length; i++) { | |
| 99 | + if (han == 2) return; | |
| 100 | + //lineWidth += ctx.measureText(str[i]).width; | |
| 101 | + lineWidth += ut.measureText(str[i], 21.3 * unit); | |
| 102 | + if (lineWidth > canvasWidth) { | |
| 103 | + han++; | |
| 104 | + | |
| 105 | + if (han == 2) { | |
| 106 | + ctx.textAlign = 'justify'; | |
| 107 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 108 | + } else { | |
| 109 | + ctx.textAlign = 'justify'; | |
| 110 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 111 | + } | |
| 112 | + initHeight += 22; //22为字体的高度 | |
| 113 | + lineWidth = 0; | |
| 114 | + lastSubStrIndex = i; | |
| 115 | + titleHeight += 20; | |
| 116 | + } | |
| 117 | + if (i == str.length - 1) { //绘制剩余部分 | |
| 118 | + ctx.textAlign = 'justify'; | |
| 119 | + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | |
| 120 | + } | |
| 121 | + } | |
| 122 | + }, | |
| 123 | + | |
| 124 | + // 生成海报 | |
| 125 | + drawPlaybill: function () { | |
| 126 | + var that = this | |
| 127 | + // 适配屏get幕 | |
| 128 | + let scale = this.data.windowWidth / 375.0 | |
| 129 | + | |
| 130 | + this.setData({ totalHeight: 667*scale}) | |
| 131 | + // 获取Canvas | |
| 132 | + let ctx = wx.createCanvasContext('myCanvas') | |
| 133 | + | |
| 134 | + // 放大 因为不放大的话,生成的分享图会模糊。暂时先注释 | |
| 135 | + ctx.scale(this.data.canvasScale, this.data.canvasScale) | |
| 136 | + | |
| 137 | + // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 138 | + // os.stoid; | |
| 139 | + | |
| 140 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 141 | + os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | |
| 142 | + + "?sceneValue=1012" + "&pageValue=packageA/pages/liveStreamDetails/liveStreamDetails" | |
| 143 | + // console.log('path3---->', path3); | |
| 144 | + | |
| 145 | + | |
| 146 | + // 绘制主背景白色 | |
| 147 | + ctx.setFillStyle('#ffffff') | |
| 148 | + ctx.fillRect(0, 0, this.data.windowWidth, this.data.totalHeight) | |
| 149 | + ctx.draw(true); | |
| 150 | + | |
| 151 | + | |
| 152 | + const coverImag = this.data.details['cover_img']; | |
| 153 | + const title = this.data.details.name; | |
| 154 | + console.log('detail--->', this.data.details); | |
| 155 | + | |
| 156 | + | |
| 157 | + //绘制头像 | |
| 158 | + wx.getImageInfo({ | |
| 159 | + src: that.data.avatarUrl, | |
| 160 | + success: function(res) { | |
| 161 | + ctx.save(); | |
| 162 | + ctx.beginPath(); | |
| 163 | + ctx.arc(29*scale, 27*scale, 14*scale, 0, 2*Math.PI); | |
| 164 | + ctx.clip(); | |
| 165 | + ctx.drawImage(res.path, 15*scale, 13*scale, 28*scale, 28*scale); | |
| 166 | + ctx.restore() | |
| 167 | + ctx.draw(true); | |
| 168 | + } | |
| 169 | + }) | |
| 170 | + | |
| 171 | + // 绘制昵称 | |
| 172 | + ctx.setFontSize(12*scale); | |
| 173 | + ctx.setFillStyle('#ADADAD'); | |
| 174 | + ctx.fillText(this.data.nickName, 54*scale, 32*scale); | |
| 175 | + | |
| 176 | + //绘制主图 | |
| 177 | + wx.getImageInfo({ | |
| 178 | + src: coverImag, | |
| 179 | + success: function(res) { | |
| 180 | + ctx.drawImage(res.path, 0, 52*scale, 240*scale, 191*scale); | |
| 181 | + ctx.draw(true); | |
| 182 | + } | |
| 183 | + }) | |
| 184 | + | |
| 185 | + //绘制文字 | |
| 186 | + ctx.setFontSize(14*scale); | |
| 187 | + ctx.setFillStyle('#1E1E1E'); | |
| 188 | + // ctx.fillText(title, 10*scale, 281*scale, 97*scale); | |
| 189 | + this.drawText(ctx, title, 10*scale, 281*scale, 130*scale, 130*scale, scale); | |
| 190 | + // ctx.draw(true); | |
| 191 | + | |
| 192 | + //绘制小程序码 | |
| 193 | + wx.getImageInfo({ | |
| 194 | + src: path3, | |
| 195 | + success: function(res) { | |
| 196 | + ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale); | |
| 197 | + ctx.draw(true); | |
| 198 | + } | |
| 199 | + }) | |
| 200 | + | |
| 201 | + //绘制文字:常按识别 | |
| 202 | + ctx.setFontSize(14*scale); | |
| 203 | + ctx.setFillStyle('#1E1E1E'); | |
| 204 | + ctx.fillText('长按识别小程序', 135*scale, 350*scale); | |
| 205 | + | |
| 206 | + | |
| 207 | + //把画板内容绘制成图片,并回调 画板图片路径 | |
| 208 | + ctx.draw(true, function() { | |
| 209 | + setTimeout(function() { | |
| 210 | + wx.canvasToTempFilePath({ | |
| 211 | + x: 0, | |
| 212 | + y: 0, | |
| 213 | + destWidth: that.data.windowWidth*2, | |
| 214 | + destHeight: that.data.windowHeight*2, | |
| 215 | + fileType: 'jpg', | |
| 216 | + quality: 1, | |
| 217 | + canvasId: 'myCanvas', | |
| 218 | + success: function(res) { | |
| 219 | + wx.hideLoading(); | |
| 220 | + that.setData({ | |
| 221 | + canvasToImgPath: res.tempFilePath, | |
| 222 | + }); | |
| 223 | + console.log(res.tempFilePath); | |
| 224 | + } | |
| 225 | + }) | |
| 226 | + }, 3000) | |
| 227 | + }); | |
| 228 | + }, | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + //点击观看直播 | |
| 233 | + clickBtn: function () { | |
| 234 | + let roomId = this.data.details.roomid; | |
| 235 | + // let customPearams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 })); | |
| 236 | + wx.navigateTo({ | |
| 237 | + url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}` | |
| 238 | + }) | |
| 239 | + }, | |
| 240 | + | |
| 241 | + // 保存图片到手机 | |
| 242 | + onSaveToPhone() { | |
| 243 | + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | |
| 244 | + this.getSetting().then((res) => { | |
| 245 | + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | |
| 246 | + if (!res.authSetting['scope.writePhotosAlbum']) { | |
| 247 | + this.authorize().then(() => { | |
| 248 | + // 同意授权后保存下载文件 | |
| 249 | + this.savedownloadFile(this.data.canvasToImgPath) | |
| 250 | + }) | |
| 251 | + } else { | |
| 252 | + // 如果已经授权,保存下载文件 | |
| 253 | + this.savedownloadFile(this.data.canvasToImgPath) | |
| 254 | + } | |
| 255 | + }) | |
| 256 | + }, | |
| 257 | + | |
| 258 | + //打开设置,引导用户授权 | |
| 259 | + onOpenSetting() { | |
| 260 | + wx.openSetting({ | |
| 261 | + success:(res) => { | |
| 262 | + console.log(res.authSetting) | |
| 263 | + } | |
| 264 | + }) | |
| 265 | + }, | |
| 266 | + | |
| 267 | + // 获取用户已经授予了哪些权限 | |
| 268 | + getSetting() { | |
| 269 | + return new Promise((resolve, reject) => { | |
| 270 | + wx.getSetting({ | |
| 271 | + success: res => { | |
| 272 | + console.log('getting---->', res); | |
| 273 | + resolve(res) | |
| 274 | + } | |
| 275 | + }) | |
| 276 | + }) | |
| 277 | + }, | |
| 278 | + | |
| 279 | + // 发起首次授权请求 | |
| 280 | + authorize() { | |
| 281 | + // isFirst 用来记录是否为首次发起授权, | |
| 282 | + // 如果首次授权拒绝后,isFirst赋值为1 | |
| 283 | + let isFirst = wx.getStorageSync('isFirst') || 0; | |
| 284 | + return new Promise((resolve, reject) => { | |
| 285 | + wx.authorize({ | |
| 286 | + scope: 'scope.writePhotosAlbum', | |
| 287 | + // 同意授权 | |
| 288 | + success: () => { | |
| 289 | + resolve() | |
| 290 | + }, | |
| 291 | + // 拒绝授权,这里是用户拒绝授权后的回调 | |
| 292 | + fail: res => { | |
| 293 | + if(isFirst === 0) { | |
| 294 | + wx.setStorageSync('isFirst', 1); | |
| 295 | + wx.showToast({ | |
| 296 | + title: '保存失败', | |
| 297 | + icon: 'none', | |
| 298 | + duration: 1000 | |
| 299 | + }) | |
| 300 | + } else { | |
| 301 | + this.showModal() | |
| 302 | + } | |
| 303 | + console.log('拒绝授权'); | |
| 304 | + reject() | |
| 305 | + } | |
| 306 | + }) | |
| 307 | + }) | |
| 308 | + }, | |
| 309 | + | |
| 310 | + //保存下载文件 | |
| 311 | + savedownloadFile(img) { | |
| 312 | + this.downLoadFile(img).then((res) => { | |
| 313 | + return this.saveImageToPhotosAlbum(res.tempFilePath) | |
| 314 | + }).then(() => { | |
| 315 | + }) | |
| 316 | + }, | |
| 317 | + | |
| 318 | + //单文件下载(下载文件资源到本地),客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径。 | |
| 319 | + downLoadFile(img) { | |
| 320 | + return new Promise((resolve, reject) => { | |
| 321 | + wx.showLoading({ | |
| 322 | + title: '保存中...', | |
| 323 | + mask: true, | |
| 324 | + }); | |
| 325 | + wx.downloadFile({ | |
| 326 | + url: img, | |
| 327 | + success: (res) => { | |
| 328 | + console.log('downloadfile', res) | |
| 329 | + resolve(res) | |
| 330 | + } | |
| 331 | + }) | |
| 332 | + }) | |
| 333 | + }, | |
| 334 | + | |
| 335 | + // 保存图片到系统相册 | |
| 336 | + saveImageToPhotosAlbum(saveUrl) { | |
| 337 | + var self = this; | |
| 338 | + return new Promise((resolve, reject) => { | |
| 339 | + wx.saveImageToPhotosAlbum({ | |
| 340 | + filePath: saveUrl, | |
| 341 | + success: (res) => { | |
| 342 | + wx.showToast({ | |
| 343 | + title: '保存成功', | |
| 344 | + duration: 1000, | |
| 345 | + }); | |
| 346 | + self.setData({ | |
| 347 | + showPlaybill: 'true' | |
| 348 | + }); | |
| 349 | + resolve() | |
| 350 | + } | |
| 351 | + }) | |
| 352 | + }) | |
| 353 | + }, | |
| 354 | + | |
| 355 | + | |
| 356 | + // 弹出模态框提示用户是否要去设置页授权 | |
| 357 | + showModal() { | |
| 358 | + wx.showModal({ | |
| 359 | + title: '检测到您没有打开保存到相册的权限,是否前往设置打开?', | |
| 360 | + success: (res) => { | |
| 361 | + if (res.confirm) { | |
| 362 | + console.log('用户点击确定') | |
| 363 | + this.onOpenSetting() // 打开设置页面 | |
| 364 | + } else if (res.cancel) { | |
| 365 | + console.log('用户点击取消') | |
| 366 | + } | |
| 367 | + } | |
| 368 | + }) | |
| 369 | + }, | |
| 370 | + /** | |
| 371 | + * 生命周期函数--监听页面加载 | |
| 372 | + */ | |
| 373 | + onLoad: function (options) { | |
| 374 | + var that = this; | |
| 375 | + this.getSystemInfo(); | |
| 376 | + | |
| 377 | + getApp().request.promiseGet("/api/weshop/wx/livelist/get",{ | |
| 378 | + data:{ id: options.id } | |
| 379 | + }).then(res=>{ | |
| 380 | + if(res.data.code==0){ | |
| 381 | + var obj = res.data.data; | |
| 382 | + var goods = JSON.parse(obj.goods); | |
| 383 | + obj.goods = goods; | |
| 384 | + that.setData({ | |
| 385 | + details: obj | |
| 386 | + }) | |
| 387 | + } | |
| 388 | + }) | |
| 389 | + | |
| 390 | + switch(options.live) { | |
| 391 | + case 'toBegin': { | |
| 392 | + this.setData({ | |
| 393 | + btnText: '订阅' | |
| 394 | + }) | |
| 395 | + break; | |
| 396 | + } | |
| 397 | + case 'ing': { | |
| 398 | + this.setData({ | |
| 399 | + btnText: '进入直播间' | |
| 400 | + }) | |
| 401 | + break; | |
| 402 | + } | |
| 403 | + default: { | |
| 404 | + this.setData({ | |
| 405 | + btnText: '回放直播' | |
| 406 | + }) | |
| 407 | + break; | |
| 408 | + } | |
| 409 | + } | |
| 410 | + | |
| 411 | + this.setData({ | |
| 412 | + nickName: app.globalData.userInfo.nickname, | |
| 413 | + avatarUrl: app.globalData.userInfo.head_pic | |
| 414 | + }) | |
| 415 | + | |
| 416 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 417 | + os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | |
| 418 | + wx.getImageInfo({ | |
| 419 | + src: path3, | |
| 420 | + success: function(res) { | |
| 421 | + // ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale); | |
| 422 | + // ctx.draw(true); | |
| 423 | + that.setData({ | |
| 424 | + ewm: res.path | |
| 425 | + }) | |
| 426 | + } | |
| 427 | + }) | |
| 428 | + }, | |
| 429 | + | |
| 430 | + // 获取图片信息 | |
| 431 | + getImageInfo(src) { | |
| 432 | + return new Promise((resolve, reject) => { | |
| 433 | + wx.getImageInfo({ | |
| 434 | + src: src, | |
| 435 | + success: (res) => { | |
| 436 | + resolve(res); | |
| 437 | + } | |
| 438 | + }) | |
| 439 | + }); | |
| 440 | + }, | |
| 441 | + | |
| 442 | + /** | |
| 443 | + * 生命周期函数--监听页面初次渲染完成 | |
| 444 | + */ | |
| 445 | + onReady: function () { | |
| 446 | + | |
| 447 | + }, | |
| 448 | + | |
| 449 | + /** | |
| 450 | + * 生命周期函数--监听页面显示 | |
| 451 | + */ | |
| 452 | + onShow: function () { | |
| 453 | + | |
| 454 | + }, | |
| 455 | + | |
| 456 | + /** | |
| 457 | + * 生命周期函数--监听页面隐藏 | |
| 458 | + */ | |
| 459 | + onHide: function () { | |
| 460 | + | |
| 461 | + }, | |
| 462 | + | |
| 463 | + /** | |
| 464 | + * 生命周期函数--监听页面卸载 | |
| 465 | + */ | |
| 466 | + onUnload: function () { | |
| 467 | + | |
| 468 | + }, | |
| 469 | + | |
| 470 | + /** | |
| 471 | + * 页面相关事件处理函数--监听用户下拉动作 | |
| 472 | + */ | |
| 473 | + onPullDownRefresh: function () { | |
| 474 | + | |
| 475 | + }, | |
| 476 | + | |
| 477 | + /** | |
| 478 | + * 页面上拉触底事件的处理函数 | |
| 479 | + */ | |
| 480 | + onReachBottom: function () { | |
| 481 | + | |
| 482 | + }, | |
| 483 | + | |
| 484 | + /** | |
| 485 | + * 用户点击右上角分享 | |
| 486 | + */ | |
| 487 | + onShareAppMessage: function () { | |
| 488 | + this.setData({ | |
| 489 | + showActionSheet: 'false' | |
| 490 | + }) | |
| 491 | + var self = this; | |
| 492 | + return { | |
| 493 | + title: this.data.details.name, | |
| 494 | + success: function(res) { | |
| 495 | + console.log('res---->', res); | |
| 496 | + }, | |
| 497 | + complete: function(res) { | |
| 498 | + console.log('comple', res) | |
| 499 | + } | |
| 500 | + } | |
| 501 | + } | |
| 502 | +}) | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.json
0 → 100644
packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml
0 → 100644
| 1 | +<!-- | |
| 2 | +此文件为开发者工具生成,生成时间: 2020/7/4 下午3:58:01 | |
| 3 | +使用方法: | |
| 4 | +1. 在"packageA\pages\liveStreamDetails\liveStreamDetails.wxml"中使用`include`指令引入此模板, | |
| 5 | +2. 在"packageA\pages\liveStreamDetails\liveStreamDetails.wxss"中使用`import`指令引入"packageA\pages\liveStreamDetails\liveStreamDetails.skeleton.wxss" | |
| 6 | +3. 书写对应的逻辑,来控制骨架屏的显示与隐藏 | |
| 7 | + | |
| 8 | +更多详细信息可以参考文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/skeleton.html | |
| 9 | +--> | |
| 10 | +<view class="sk-container"></view> | |
| 0 | 11 | \ No newline at end of file | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss
0 → 100644
| 1 | +/* | |
| 2 | +此文件为开发者工具生成,生成时间: 2020/7/4 下午3:58:01 | |
| 3 | +使用方法:参考 "packageA\pages\liveStreamDetails\liveStreamDetails.skeleton.wxml" | |
| 4 | +*/ | |
| 5 | +.sk-transparent { | |
| 6 | + color: transparent !important; | |
| 7 | + } | |
| 8 | +.sk-container { | |
| 9 | + position: absolute; | |
| 10 | + overflow: hidden; | |
| 11 | + top: 0; | |
| 12 | + left: 0; | |
| 13 | + right: 0; | |
| 14 | + bottom: 0; | |
| 15 | + z-index: 1000000; | |
| 16 | + background-color: transparent; | |
| 17 | + } | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.wxml
0 → 100644
| 1 | +<!--pages/liveStreamDetails/liveStreamDetails.wxml--> | |
| 2 | +<wxs src="../../../utils/filter.wxs" module="filter"></wxs> | |
| 3 | +<wxs src="../../../utils/myUtils.wxs" module="myUtils"></wxs> | |
| 4 | +<!-- <wxs src="/packageA/pages/liveStreamDetails/wxs.wxs" module="tool"></wxs> --> | |
| 5 | +<view class="content"> | |
| 6 | + <!-- 封面标题 --> | |
| 7 | + <view class="cover-container"> | |
| 8 | + <image src="{{details.cover_img}}" class="cover-img" mode="aspectFill"></image> | |
| 9 | + <!-- <view class="cover-desc"> | |
| 10 | + <view>{{details.name}}</view> | |
| 11 | + <view>{{filter.format_time(details.start_time)}}</view> | |
| 12 | + </view> --> | |
| 13 | + </view> | |
| 14 | + | |
| 15 | + <!-- 直播详情 --> | |
| 16 | + <view class="desc-container"> | |
| 17 | + <view class="desc-title">{{details.name}}</view> | |
| 18 | + <text class="desc-status">{{myUtils.liveStatus(details.live_status)}}</text> | |
| 19 | + <!-- <view class="desc-content"> | |
| 20 | + <view>6月24日20:00锁定直播 盘点年中 「上榜」好货!</view> | |
| 21 | + <view>护肤、彩妆、香氛群星汇聚,更有折扣买赠与神秘新品加持~</view> | |
| 22 | + <view>多轮抽奖惊喜连连,不容错过!</view> | |
| 23 | + </view> --> | |
| 24 | + </view> | |
| 25 | + | |
| 26 | + <!-- 列表 --> | |
| 27 | + <view class="list"> | |
| 28 | + <!-- 列表项 --> | |
| 29 | + <block wx:for="{{details.goods}}"> | |
| 30 | + <view class="list-item" bindtap="clickgoods" data-url="{{item.url}}"> | |
| 31 | + <!-- {{item}} --> | |
| 32 | + <image src="{{item.cover_img}}" class="item-pic"></image> | |
| 33 | + <view class="item-desc-container"> | |
| 34 | + <view class="item-desc"> | |
| 35 | + <!-- <view>WEI</view> --> | |
| 36 | + <view>{{item.name}}</view> | |
| 37 | + </view> | |
| 38 | + <view class="item-price">{{item.price}}</view> | |
| 39 | + </view> | |
| 40 | + </view> | |
| 41 | + </block> | |
| 42 | + | |
| 43 | + </view> | |
| 44 | + | |
| 45 | + <!-- 回放直播 --> | |
| 46 | + <view class="btn-container"> | |
| 47 | + <subscribe wx:if="{{details.live_status === '102'}}" class="btn" room-id="{{details.roomid}}" stopPropagation="{{true}}"></subscribe> | |
| 48 | + <view wx:else class="btn" bindtap="clickBtn">{{btnText}}</view> | |
| 49 | + </view> | |
| 50 | + | |
| 51 | + <!-- 分享 --> | |
| 52 | + <view class="share-container"> | |
| 53 | + <image src="/packageA/images/liveStreamDetails/share.jpg" bindtap="clickShare"></image> | |
| 54 | + <image src="/packageA/images/liveStreamDetails/home.jpg" bindtap="backHome"></image> | |
| 55 | + </view> | |
| 56 | + | |
| 57 | + <!-- actionSheet --> | |
| 58 | + <view class="{{showActionSheet ? 'share-actionSheet':'share-actionSheet active'}}" hidden="{{showActionSheet}}"> | |
| 59 | + <view class="share-actionSheet-title">分享</view> | |
| 60 | + <view class="share-actionSheet-list"> | |
| 61 | + <view class="share-actionSheet-item" hover-class="active"> | |
| 62 | + <button open-type="share"> | |
| 63 | + <image src="/packageA/images/liveStreamDetails/friend.jpg" class="share-actionSheet-pic"></image> | |
| 64 | + <text class="share-actionSheet-desc">发送给朋友</text> | |
| 65 | + </button> | |
| 66 | + </view> | |
| 67 | + <view class="share-actionSheet-item" hover-class="active" bindtap="createPlaybill"> | |
| 68 | + <image src="/packageA/images/liveStreamDetails/circle.jpg" class="share-actionSheet-pic"></image> | |
| 69 | + <text class="share-actionSheet-desc">生成分享海报</text> | |
| 70 | + </view> | |
| 71 | + </view> | |
| 72 | + <view class="share-actionSheet-cancle" bindtap="hiddenActionSheet">取消</view> | |
| 73 | + </view> | |
| 74 | + | |
| 75 | + <!-- 生成海报 --> | |
| 76 | + <view class="{{showPlaybill ? 'playbill':'playbill active'}}" hidden="{{showPlaybill}}"> | |
| 77 | + <!-- <image src="{{canvasToImgPath}}" class="playbill-pic"></image> --> | |
| 78 | + <canvas canvas-id="myCanvas" class="playbill-pic" style="width:{{windowWidth*dpr}};height:width:{{windowHeight*dpr}}"></canvas> | |
| 79 | + <view class="playbill-save" bindtap="onSaveToPhone"> | |
| 80 | + <image src="/packageA/images/liveStreamDetails/save.jpg"></image>保存至相册 | |
| 81 | + </view> | |
| 82 | + </view> | |
| 83 | + | |
| 84 | + <!-- mask --> | |
| 85 | + <!-- 这里mask必须强制放在actionsheet和playbill的后面 --> | |
| 86 | + <view class="mask" bindtap="hiddenActionSheet"></view> | |
| 87 | + | |
| 88 | +</view> | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.wxss
0 → 100644
| 1 | +/* pages/liveStreamDetails/liveStreamDetails.wxss */ | |
| 2 | +.active { | |
| 3 | + background-color: #ddd; | |
| 4 | +} | |
| 5 | + | |
| 6 | +.content { | |
| 7 | + background-color: white; | |
| 8 | + padding-bottom: 168rpx; | |
| 9 | +} | |
| 10 | +.cover-container { | |
| 11 | + height: 646rpx; | |
| 12 | + position: relative; | |
| 13 | +} | |
| 14 | +.cover-img { | |
| 15 | + width: 100%; | |
| 16 | + height: 100%; | |
| 17 | +} | |
| 18 | +.cover-desc { | |
| 19 | + position: absolute; | |
| 20 | + bottom: 0; | |
| 21 | + width: 100%; | |
| 22 | + text-align: center; | |
| 23 | + padding-top: 64rpx; | |
| 24 | + padding-bottom: 64rpx; | |
| 25 | + color: #fff; | |
| 26 | + | |
| 27 | + background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/ | |
| 28 | + background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/ | |
| 29 | + background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/ | |
| 30 | + background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/ | |
| 31 | +} | |
| 32 | +.cover-desc view:first-child { | |
| 33 | + font-size: 50rpx; | |
| 34 | +} | |
| 35 | +.cover-desc view:last-child { | |
| 36 | + font-size: 42rpx; | |
| 37 | +} | |
| 38 | + | |
| 39 | +.desc-container { | |
| 40 | + padding: 56rpx 46rpx 41rpx; | |
| 41 | + color: #3E3E3E; | |
| 42 | +} | |
| 43 | +.desc-title { | |
| 44 | + font-size: 42rpx; | |
| 45 | + font-weight: bold; | |
| 46 | +} | |
| 47 | +.desc-status { | |
| 48 | + display: inline-block; | |
| 49 | + color: #5B5B5B; | |
| 50 | + font-size: 28rpx; | |
| 51 | + height: 50rpx; | |
| 52 | + line-height: 50rpx; | |
| 53 | + padding: 0 30rpx; | |
| 54 | + background-color: #eee; | |
| 55 | + margin-top: 22rpx; | |
| 56 | + margin-bottom: 44rpx; | |
| 57 | +} | |
| 58 | +.desc-content { | |
| 59 | + font-size: 29rpx; | |
| 60 | +} | |
| 61 | +.list { | |
| 62 | + padding: 0 36rpx; | |
| 63 | +} | |
| 64 | +.list-item { | |
| 65 | + display: flex; | |
| 66 | + padding-bottom: 34rpx; | |
| 67 | +} | |
| 68 | +.list-item:not(:first-child) { | |
| 69 | + padding-top: 34rpx; | |
| 70 | +} | |
| 71 | +.list-item:not(:last-child) { | |
| 72 | + border-bottom: 2rpx solid #B5B5B5; | |
| 73 | +} | |
| 74 | +.item-pic { | |
| 75 | + width: 224rpx; | |
| 76 | + height: 224rpx; | |
| 77 | + border: 2rpx solid #E1E1E1; | |
| 78 | +} | |
| 79 | +.item-desc-container { | |
| 80 | + padding-left: 46rpx; | |
| 81 | + font-size: 24rpx; | |
| 82 | + display: flex; | |
| 83 | + flex-direction: column; | |
| 84 | + justify-content: space-between; | |
| 85 | +} | |
| 86 | +.item-desc view:first-child { | |
| 87 | + padding-top: 10rpx; | |
| 88 | + padding-bottom: 38rpx; | |
| 89 | +} | |
| 90 | +.item-price:before { | |
| 91 | + content: '¥'; | |
| 92 | +} | |
| 93 | + | |
| 94 | +.share-container { | |
| 95 | + /* width: 86rpx; */ | |
| 96 | + position: fixed; | |
| 97 | + padding: 0 8rpx; | |
| 98 | + box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.1); | |
| 99 | + right: 28rpx; | |
| 100 | + top: 50%; | |
| 101 | + background-color: #fff; | |
| 102 | +} | |
| 103 | +.share-container image { | |
| 104 | + display: block; | |
| 105 | + width: 60rpx; | |
| 106 | + height: 60rpx; | |
| 107 | + padding-top: 14rpx; | |
| 108 | + padding-bottom: 11rpx; | |
| 109 | +} | |
| 110 | +.share-container image:first-child { | |
| 111 | + border-bottom: 2rpx solid #E7E7E7; | |
| 112 | +} | |
| 113 | + | |
| 114 | + | |
| 115 | +.btn-container { | |
| 116 | + background-color: #fff; | |
| 117 | + box-sizing: border-box; | |
| 118 | + padding: 24rpx 128rpx; | |
| 119 | + position: fixed; | |
| 120 | + bottom: 0; | |
| 121 | + width: 100%; | |
| 122 | + box-shadow: 0px -1px 4px 1px rgba(0,0,0,0.1); | |
| 123 | +} | |
| 124 | +.btn { | |
| 125 | + color: #fff; | |
| 126 | + background-color: #000; | |
| 127 | + font-size: 36rpx; | |
| 128 | + line-height: 120rpx; | |
| 129 | + text-align: center; | |
| 130 | + /* width: 618rpx; | |
| 131 | + height: 92rpx; */ | |
| 132 | +} | |
| 133 | +.subscribe--live-player-notSubscribe { | |
| 134 | + position: relative; | |
| 135 | +} | |
| 136 | +.subscribe--live-player-notSubscribe::before { | |
| 137 | + content: '订阅'; | |
| 138 | + position: absolute; | |
| 139 | + left: 0; | |
| 140 | + width: 100%; | |
| 141 | + height: auto; | |
| 142 | + background-color: #000; | |
| 143 | + color: #fff; | |
| 144 | +} | |
| 145 | +.subscribe--live-player-subscribe__btn { | |
| 146 | + width: 100% !important; | |
| 147 | + height: auto !important; | |
| 148 | + font-size: 36rpx !important; | |
| 149 | + line-height: 120rpx !important; | |
| 150 | + border-radius: 0 !important; | |
| 151 | + background-color: #000 !important; | |
| 152 | +} | |
| 153 | +.subscribe--live-player-hasSubscribe { | |
| 154 | + background-color: #666 !important; | |
| 155 | +} | |
| 156 | + | |
| 157 | +.share-actionSheet { | |
| 158 | + background-color: white; | |
| 159 | + padding-top: 45rpx; | |
| 160 | + position: fixed; | |
| 161 | + width: 100%; | |
| 162 | + bottom: 0; | |
| 163 | + z-index: 2; | |
| 164 | +} | |
| 165 | +.share-actionSheet-title { | |
| 166 | + font-size: 38rpx; | |
| 167 | + | |
| 168 | +} | |
| 169 | +.share-actionSheet-list { | |
| 170 | + display: flex; | |
| 171 | + justify-content: space-around; | |
| 172 | + padding-bottom: 30rpx; | |
| 173 | +} | |
| 174 | +.share-actionSheet-item { | |
| 175 | + text-align: center; | |
| 176 | + padding: 20rpx; | |
| 177 | +} | |
| 178 | +.share-actionSheet-pic { | |
| 179 | + display: block; | |
| 180 | + width: 118rpx; | |
| 181 | + height: 118rpx; | |
| 182 | + border-radius: 50%; | |
| 183 | + margin: 0 auto; | |
| 184 | +} | |
| 185 | +.share-actionSheet-desc { | |
| 186 | + font-size: 28rpx; | |
| 187 | +} | |
| 188 | + | |
| 189 | +.share-actionSheet-title, | |
| 190 | +.share-actionSheet-cancle { | |
| 191 | + text-align: center; | |
| 192 | +} | |
| 193 | + | |
| 194 | +.share-actionSheet-cancle { | |
| 195 | + padding: 30rpx 0; | |
| 196 | + border-top: 2rpx solid #CBCBCB; | |
| 197 | +} | |
| 198 | + | |
| 199 | +.mask { | |
| 200 | + display: none; | |
| 201 | + background-color: rgba(0,0,0,.7); | |
| 202 | + position: fixed; | |
| 203 | + top: 0; | |
| 204 | + bottom: 0; | |
| 205 | + left: 0; | |
| 206 | + right: 0; | |
| 207 | +} | |
| 208 | +.playbill { | |
| 209 | + position: fixed; | |
| 210 | + left: 50%; | |
| 211 | + top: 50%; | |
| 212 | + transform: translate(-50%, -50%); | |
| 213 | + z-index: 9999; | |
| 214 | + background: none; | |
| 215 | +} | |
| 216 | +.share-actionSheet.active ~ .mask, | |
| 217 | +.playbill.active ~ .mask { | |
| 218 | + display: block; | |
| 219 | +} | |
| 220 | + | |
| 221 | +.playbill-pic { | |
| 222 | + width: 478rpx; | |
| 223 | + height: 737rpx; | |
| 224 | + border-width: 31rpx 20rpx 51rpx; | |
| 225 | + border-color: black; | |
| 226 | + border-style: solid; | |
| 227 | + margin: 0 auto 26rpx; | |
| 228 | +} | |
| 229 | + | |
| 230 | +.playbill-save { | |
| 231 | + width: 560rpx; | |
| 232 | + height: 100rpx; | |
| 233 | + line-height: 100rpx; | |
| 234 | + background-color: black; | |
| 235 | + color: #fff; | |
| 236 | + font-size: 36rpx; | |
| 237 | + text-align: center; | |
| 238 | +} | |
| 239 | +.playbill-save image { | |
| 240 | + width: 44rpx; | |
| 241 | + height: 36rpx; | |
| 242 | + margin-right: 23rpx; | |
| 243 | +} | |
| 244 | + | |
| 245 | +button::after { | |
| 246 | + border: none; | |
| 247 | +} | |
| 0 | 248 | \ No newline at end of file | ... | ... |
packageA/pages/prom_list/prom_list.js
| ... | ... | @@ -12,6 +12,7 @@ var utils = require('../../../utils/util.js'),ut=utils; |
| 12 | 12 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 13 | 13 | |
| 14 | 14 | |
| 15 | + | |
| 15 | 16 | Page({ |
| 16 | 17 | data: { |
| 17 | 18 | gid: "", |
| ... | ... | @@ -1568,6 +1569,12 @@ Page({ |
| 1568 | 1569 | price=price.toFixed(2); |
| 1569 | 1570 | cut_pirce=cut_pirce.toFixed(2); |
| 1570 | 1571 | this.setData({dp_price: this.data.dp_price,cut_price:this.data.cut_price}); |
| 1572 | + }, | |
| 1573 | + | |
| 1574 | + go_goods:function (e) { | |
| 1575 | + var gid=e.currentTarget.dataset.gid; | |
| 1576 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gid; | |
| 1577 | + getApp().goto(url); | |
| 1571 | 1578 | } |
| 1572 | 1579 | |
| 1573 | 1580 | ... | ... |
packageA/pages/prom_list/prom_list.wxml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <view class="goods_list" wx:if="{{data && data.goods_name}}"> |
| 7 | 7 | <view class="item flex ai-center"> |
| 8 | 8 | <view style="width:80rpx;height: 100%" class="flex ai-center jc-center"><icon type="success" size="18"></icon></view> |
| 9 | - <view class="r_box flex"> | |
| 9 | + <view class="r_box flex" bindtap="go_goods" data-gid="{{data.goods_id}}"> | |
| 10 | 10 | <view><image class="r_box_img" src="{{data.original_img}}"></image></view> |
| 11 | 11 | <view class="flex jc_sb"> |
| 12 | 12 | <view class="fs30" style="margin: 18rpx"> |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | <icon bindtap="set_sele" wx:else data-ind="{{index}}" data-set="1" type="success" size="18" color="#adadad"></icon> |
| 27 | 27 | |
| 28 | 28 | </view> |
| 29 | - <view class="r_box flex"> | |
| 29 | + <view class="r_box flex" bindtap="go_goods" data-gid="{{item.goods_id}}"> | |
| 30 | 30 | <view><image class="r_box_img" src="{{iurl+item.original_img}}" binderror="bind_bnerr3" data-errorimg="collocationList[{{index}}].original_img"></image></view> |
| 31 | 31 | <view class="flex jc_sb"> |
| 32 | 32 | <view class="fs30" style="margin: 18rpx"> | ... | ... |
pages/cart/cart/cart.wxss
pages/cart/cart2/cart2.js
| ... | ... | @@ -1381,6 +1381,13 @@ Page({ |
| 1381 | 1381 | //是不是重新提交 |
| 1382 | 1382 | if(th.data.is_continue==1) item.is_continue=1; |
| 1383 | 1383 | |
| 1384 | + //获取立即购买的商品的信息 | |
| 1385 | + var gg = to.get_b_now(); | |
| 1386 | + //--商品的房间号-- | |
| 1387 | + if(gg.room_id && gg.room_id>0){ | |
| 1388 | + item.room_ids=gg.room_id; | |
| 1389 | + } | |
| 1390 | + | |
| 1384 | 1391 | var order_prom_list={}; |
| 1385 | 1392 | //--判断有没有优惠活动-- |
| 1386 | 1393 | if(th.data.order_prom[item.pickup_id]){ |
| ... | ... | @@ -1418,7 +1425,7 @@ Page({ |
| 1418 | 1425 | item.coupon_no=th.data.using_quan[th.data.bn_pick].coupon_no; |
| 1419 | 1426 | item.coupon_price=0; |
| 1420 | 1427 | } |
| 1421 | - var gg = to.get_b_now(); | |
| 1428 | + | |
| 1422 | 1429 | var goods={ |
| 1423 | 1430 | 'goods_id': gg.goods_id, |
| 1424 | 1431 | 'goods_name': gg.goods_name, |
| ... | ... | @@ -1445,6 +1452,11 @@ Page({ |
| 1445 | 1452 | }) |
| 1446 | 1453 | } |
| 1447 | 1454 | |
| 1455 | + //--商品的房间号-- | |
| 1456 | + if(gg.room_id && gg.room_id>0){ | |
| 1457 | + goods.room_id=gg.room_id; | |
| 1458 | + } | |
| 1459 | + | |
| 1448 | 1460 | //如果不立即购买或者秒杀,如果是线下库存购买的时候 |
| 1449 | 1461 | if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){ |
| 1450 | 1462 | var isok=1; |
| ... | ... | @@ -1495,8 +1507,7 @@ Page({ |
| 1495 | 1507 | var addr = th.data.user_addr; |
| 1496 | 1508 | if (th.data.is_all_zt == 1) addr = null; |
| 1497 | 1509 | var val_arr= t.detail.value; |
| 1498 | - console.log('购物车结算'); | |
| 1499 | - console.log(val_arr); | |
| 1510 | + | |
| 1500 | 1511 | |
| 1501 | 1512 | if(th.data.is_all_zt !=1) |
| 1502 | 1513 | if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){ |
| ... | ... | @@ -1505,6 +1516,7 @@ Page({ |
| 1505 | 1516 | } |
| 1506 | 1517 | |
| 1507 | 1518 | var order_prom_list_cart=th.data.order_prom_list_cart; |
| 1519 | + | |
| 1508 | 1520 | //--组装推送数据-- |
| 1509 | 1521 | for (var i = 0; i < order_prom_list_cart.length;i++){ |
| 1510 | 1522 | var t_item = order_prom_list_cart[i]; |
| ... | ... | @@ -1569,8 +1581,11 @@ Page({ |
| 1569 | 1581 | } |
| 1570 | 1582 | if(Object.keys(order_prom_list).length>0) |
| 1571 | 1583 | item.order_prom_list=order_prom_list; |
| 1572 | - //-------------让商品添加到商品列表-------------------- | |
| 1573 | - for (var k = 0; k < t_item.goods.length;k++){ | |
| 1584 | + | |
| 1585 | + //房间号的ids | |
| 1586 | + var room_ids=""; | |
| 1587 | + //-------------让商品添加到商品列表-------------------- | |
| 1588 | + for (var k = 0; k < t_item.goods.length;k++){ | |
| 1574 | 1589 | var g_item = t_item.goods[k]; |
| 1575 | 1590 | var goods = { |
| 1576 | 1591 | 'goods_id': g_item.goods_id, |
| ... | ... | @@ -1644,12 +1659,20 @@ Page({ |
| 1644 | 1659 | } |
| 1645 | 1660 | }) |
| 1646 | 1661 | } |
| 1647 | - | |
| 1662 | + //如果房间号不为空的时候 | |
| 1663 | + if(g_item.room_id){ | |
| 1664 | + goods.room_id=g_item.room_id; | |
| 1665 | + room_ids+=g_item.room_id+","; | |
| 1666 | + } | |
| 1648 | 1667 | item.order_goods.push(goods); |
| 1649 | 1668 | } |
| 1669 | + | |
| 1670 | + //如果房间号不为空的时候 | |
| 1671 | + if(room_ids!="") item.room_ids= ut.sub_last(room_ids); | |
| 1650 | 1672 | pdata.push(item); |
| 1651 | 1673 | } |
| 1652 | - console.log(pdata); | |
| 1674 | + | |
| 1675 | + | |
| 1653 | 1676 | } |
| 1654 | 1677 | |
| 1655 | 1678 | if (pdata.length==0) return; | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
| ... | ... | @@ -449,7 +449,13 @@ Page({ |
| 449 | 449 | }) |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - item.order_goods.push(goods); | |
| 452 | + //--商品的房间号-- | |
| 453 | + if(gg.room_id && gg.room_id>0){ | |
| 454 | + item.room_ids=gg.room_id; | |
| 455 | + goods.room_id=gg.room_id; | |
| 456 | + } | |
| 457 | + | |
| 458 | + item.order_goods.push(goods); | |
| 453 | 459 | pdata.push(item); |
| 454 | 460 | |
| 455 | 461 | if (pdata.length==0) return; | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
| ... | ... | @@ -28,6 +28,7 @@ Page({ |
| 28 | 28 | code: "", //核销码 |
| 29 | 29 | c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期 |
| 30 | 30 | is_lb: 0, //是否有礼包 |
| 31 | + default_color:null, | |
| 31 | 32 | }, |
| 32 | 33 | onLoad: function(options) { |
| 33 | 34 | |
| ... | ... | @@ -60,6 +61,13 @@ Page({ |
| 60 | 61 | var that = this.data; |
| 61 | 62 | var th = this; |
| 62 | 63 | // var id = e.currentTarget.dataset.id;//活动id |
| 64 | + //如果还没有开始的话 | |
| 65 | + if(th.data.isStart!=1){ | |
| 66 | + getApp().my_warnning("活动还没有开始", 0, th); | |
| 67 | + return false; | |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 63 | 71 | var money = e.currentTarget.dataset.money; |
| 64 | 72 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 65 | 73 | my_confirm.open( |
| ... | ... | @@ -100,7 +108,7 @@ Page({ |
| 100 | 108 | getApp().goto(url); |
| 101 | 109 | }, |
| 102 | 110 | fail: function(n) { |
| 103 | - getApp().my_confirm("取消支付", 0, th); | |
| 111 | + getApp().my_warnning("取消支付", 0, th); | |
| 104 | 112 | } |
| 105 | 113 | }); |
| 106 | 114 | } else { |
| ... | ... | @@ -124,6 +132,12 @@ Page({ |
| 124 | 132 | GetBuyIntegral: function(e) { |
| 125 | 133 | var that = this.data; |
| 126 | 134 | var th = this; |
| 135 | + | |
| 136 | + //如果还没有开始的话 | |
| 137 | + if(th.data.isStart!=1){ | |
| 138 | + getApp().my_warnning("活动还没有开始", 0, th); | |
| 139 | + return false; | |
| 140 | + } | |
| 127 | 141 | // var id = e.currentTarget.dataset.id;//活动id |
| 128 | 142 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 129 | 143 | my_confirm.open( |
| ... | ... | @@ -177,7 +191,8 @@ Page({ |
| 177 | 191 | if (res.data.code == 0) { |
| 178 | 192 | th.setData({ |
| 179 | 193 | giftImage: th.data.iurl + res.data.data.lbUrl, |
| 180 | - giftTitle: res.data.data.giftTitle | |
| 194 | + giftTitle: res.data.data.giftTitle, | |
| 195 | + default_color:res.data.data.bgcolor | |
| 181 | 196 | }) |
| 182 | 197 | if (res.data.data.giftRemark == '') { |
| 183 | 198 | th.setData({ |
| ... | ... | @@ -245,7 +260,8 @@ Page({ |
| 245 | 260 | if (res.data.code == 0) { |
| 246 | 261 | _this2.setData({ |
| 247 | 262 | giftImage: th.iurl + res.data.data.lbUrl, |
| 248 | - giftTitle: res.data.data.giftTitle | |
| 263 | + giftTitle: res.data.data.giftTitle, | |
| 264 | + default_color:res.data.data.bgcolor | |
| 249 | 265 | }) |
| 250 | 266 | if (res.data.data.giftRemark == '') { |
| 251 | 267 | _this2.setData({ |
| ... | ... | @@ -257,6 +273,14 @@ Page({ |
| 257 | 273 | }) |
| 258 | 274 | } |
| 259 | 275 | |
| 276 | + var isStart=0; | |
| 277 | + var now=ut.gettimestamp(); | |
| 278 | + | |
| 279 | + var str = res.data.data.starTime.replace(/-/g,'/'); | |
| 280 | + var start = Date.parse(new Date(str)); | |
| 281 | + start = start / 1000; | |
| 282 | + if(start<now) isStart=1; | |
| 283 | + | |
| 260 | 284 | _this2.setData({ |
| 261 | 285 | giftDate: res.data.data.endTime, |
| 262 | 286 | giftPosPrice: res.data.data.giftPosPrice, |
| ... | ... | @@ -265,7 +289,8 @@ Page({ |
| 265 | 289 | giftPrice: res.data.data.payMoney, |
| 266 | 290 | giftType: res.data.data.actType, |
| 267 | 291 | actTitle: res.data.data.actTitle, |
| 268 | - wareCard: res.data.data.wareCard | |
| 292 | + wareCard: res.data.data.wareCard, | |
| 293 | + isStart:isStart, | |
| 269 | 294 | }) |
| 270 | 295 | } else { |
| 271 | 296 | getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); |
| ... | ... | @@ -346,5 +371,29 @@ Page({ |
| 346 | 371 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| 347 | 372 | nav_b.close_box(); |
| 348 | 373 | nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy"); |
| 349 | - } | |
| 374 | + }, | |
| 375 | + | |
| 376 | + //--- 分享设置 -- | |
| 377 | + onShareAppMessage: function (e) { | |
| 378 | + var curPage=this; | |
| 379 | + var pagePath = curPage.route; //当前页面url | |
| 380 | + if (pagePath.indexOf('/') != 0) { | |
| 381 | + pagePath = '/' + pagePath; | |
| 382 | + } | |
| 383 | + | |
| 384 | + pagePath+="?isBuy="+this.data.isBuy; | |
| 385 | + if(this.data.isBuy==0){ | |
| 386 | + pagePath+="&lbId="+this.data.getGiftID; | |
| 387 | + }else{ | |
| 388 | + pagePath+="&orderSn="+this.data.orderSn; | |
| 389 | + } | |
| 390 | + | |
| 391 | + return { | |
| 392 | + title: "礼包详情", | |
| 393 | + path:pagePath, | |
| 394 | + } | |
| 395 | + }, | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 350 | 399 | }); |
| 351 | 400 | \ No newline at end of file | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
| 1 | -<view class="box data-v-3a5b7e36"> | |
| 1 | +<view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}"> | |
| 2 | 2 | <view class="box_top data-v-3a5b7e36"> |
| 3 | 3 | <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> |
| 4 | 4 | </view> |
| 5 | - <view class="box_title data-v-3a5b7e36"> | |
| 5 | + <view class="box_title data-v-3a5b7e36" > | |
| 6 | 6 | <view class="top_title data-v-3a5b7e36"> |
| 7 | 7 | <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> |
| 8 | 8 | </view> |
| 9 | 9 | <view class="top_time data-v-3a5b7e36"> |
| 10 | - <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | |
| 10 | + <text class="data-v-3a5b7e36" wx:if="{{isBuy==0}}">{{"兑换截至时间:"+giftDate}}</text> | |
| 11 | + <text class="data-v-3a5b7e36" wx:else>{{"活动结束至时间:"+giftDate}}</text> | |
| 11 | 12 | </view> |
| 12 | 13 | <view class="top_price data-v-3a5b7e36"> |
| 13 | 14 | <block wx:if="{{giftPrice>0}}"> |
| ... | ... | @@ -102,22 +103,22 @@ |
| 102 | 103 | <block wx:if="{{isBuy==1}}"> |
| 103 | 104 | <view class="foot_button data-v-3a5b7e36"> |
| 104 | 105 | <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> |
| 105 | - <view class="foot_button_left data-v-3a5b7e36" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
| 106 | - <text class="data-v-3a5b7e36">立即购买</text> | |
| 106 | + <view class="foot_button_left data-v-3a5b7e36 {{isStart?'':'gray'}}" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
| 107 | + <text class="data-v-3a5b7e36 ">立即购买</text> | |
| 107 | 108 | </view> |
| 108 | 109 | </block> |
| 109 | 110 | <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
| 110 | - <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 111 | + <view class="foot_button_right data-v-3a5b7e36 {{isStart?'':'gray'}}" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 111 | 112 | <text class="data-v-3a5b7e36">立即兑换</text> |
| 112 | 113 | </view> |
| 113 | 114 | </block> |
| 114 | 115 | <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> |
| 115 | - <view class="foot_button_buy data-v-3a5b7e36" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
| 116 | + <view class="foot_button_buy data-v-3a5b7e36 {{isStart?'':'gray'}}" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
| 116 | 117 | <text class="data-v-3a5b7e36">立即购买</text> |
| 117 | 118 | </view> |
| 118 | 119 | </block> |
| 119 | 120 | <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> |
| 120 | - <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 121 | + <view class="foot_button_intalge data-v-3a5b7e36 {{isStart?'':'gray'}}" bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 121 | 122 | <text class="data-v-3a5b7e36">立即兑换</text> |
| 122 | 123 | </view> |
| 123 | 124 | </block> | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxss
| ... | ... | @@ -197,6 +197,7 @@ |
| 197 | 197 | font-size: 28rpx; |
| 198 | 198 | line-height: 70rpx; |
| 199 | 199 | border-radius: 40rpx; |
| 200 | + margin-right: 20rpx; | |
| 200 | 201 | } |
| 201 | 202 | |
| 202 | 203 | .foot_button_right.data-v-3a5b7e36 { |
| ... | ... | @@ -243,3 +244,6 @@ page.data-v-3a5b7e36 { |
| 243 | 244 | .overdue.data-v-3a5b7e36{ |
| 244 | 245 | background-color: rgb(153,153,153); |
| 245 | 246 | } |
| 247 | + | |
| 248 | +.foot_button_left.data-v-3a5b7e36.gray{ background-color: #aaa; } | |
| 249 | +.foot_button_right.data-v-3a5b7e36.gray{ background-color: #aaa;} | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -116,4 +116,19 @@ Page({ |
| 116 | 116 | |
| 117 | 117 | }, |
| 118 | 118 | |
| 119 | + | |
| 120 | +//--- 分享设置 -- | |
| 121 | +onShareAppMessage: function (e) { | |
| 122 | + var curPage=this; | |
| 123 | + var pagePath = curPage.route; //当前页面url | |
| 124 | + if (pagePath.indexOf('/') != 0) { | |
| 125 | + pagePath = '/' + pagePath; | |
| 126 | + } | |
| 127 | + return { | |
| 128 | + title: "专享礼包", | |
| 129 | + path:pagePath, | |
| 130 | + } | |
| 131 | +}, | |
| 132 | + | |
| 133 | + | |
| 119 | 134 | }); |
| 120 | 135 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxss
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -252,13 +252,14 @@ Page({ |
| 252 | 252 | that = ee, |
| 253 | 253 | th = ee, |
| 254 | 254 | gid = t.goods_id, |
| 255 | - first_leader=t.first_leader; | |
| 255 | + first_leader=t.first_leader, | |
| 256 | + room_id=t.room_id; | |
| 256 | 257 | |
| 257 | 258 | //---获取手机地址坐标-- |
| 258 | 259 | //--如果tg_id是空的话,分享回来-- |
| 259 | 260 | if (gid == undefined || gid == null || gid == "") { |
| 260 | 261 | var gid_str = decodeURIComponent(t.scene); |
| 261 | - gid_str.split("_"); | |
| 262 | + gid_str=gid_str.split("_"); | |
| 262 | 263 | gid=gid_str[0]; |
| 263 | 264 | if(gid_str.length>1){ |
| 264 | 265 | first_leader=gid_str[1]; |
| ... | ... | @@ -275,6 +276,12 @@ Page({ |
| 275 | 276 | }) |
| 276 | 277 | } |
| 277 | 278 | |
| 279 | + if(room_id){ | |
| 280 | + getApp().globalData.room_id=room_id; | |
| 281 | + getApp().globalData.room_goods_id=gid; | |
| 282 | + } | |
| 283 | + | |
| 284 | + | |
| 278 | 285 | var c_guide_id=t.c_guide_id; |
| 279 | 286 | if(c_guide_id){ |
| 280 | 287 | th.data.c_guide_id=c_guide_id; |
| ... | ... | @@ -657,6 +664,7 @@ Page({ |
| 657 | 664 | if (t.data.data.goods_content == null) t.data.data.goods_content = ""; |
| 658 | 665 | |
| 659 | 666 | //-----商品详情--- |
| 667 | + if(!t.data.data.goods_content) t.data.data.goods_content=" "; | |
| 660 | 668 | a.wxParse("content", "html", t.data.data.goods_content, ee, 6); |
| 661 | 669 | e.wxParseAddFullImageUrl(ee, "content"); |
| 662 | 670 | |
| ... | ... | @@ -978,6 +986,16 @@ Page({ |
| 978 | 986 | } |
| 979 | 987 | } |
| 980 | 988 | |
| 989 | + //让商品带上房间号 | |
| 990 | + //让商品带上房间号 | |
| 991 | + if(th.data.sys_switch.is_skuroom_id==1){ | |
| 992 | + if(th.data.data.goods_id==getApp().globalData.room_goods_id){ | |
| 993 | + newd.room_id=getApp().globalData.room_id; | |
| 994 | + } | |
| 995 | + }else{ | |
| 996 | + if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id; | |
| 997 | + } | |
| 998 | + | |
| 981 | 999 | //如果是积分够,is_integral_normal就要有积分购普通购买字段 |
| 982 | 1000 | if(o.prom_type==4){ |
| 983 | 1001 | newd.is_integral_normal=1; |
| ... | ... | @@ -2836,6 +2854,19 @@ Page({ |
| 2836 | 2854 | } |
| 2837 | 2855 | } |
| 2838 | 2856 | |
| 2857 | + //让商品带上房间号 | |
| 2858 | + if(th.data.sys_switch.is_skuroom_id==1){ | |
| 2859 | + if(th.data.data.goods_id==getApp().globalData.room_goods_id){ | |
| 2860 | + newd.room_id=getApp().globalData.room_id; | |
| 2861 | + } | |
| 2862 | + }else{ | |
| 2863 | + if(newd.goods_id==getApp().globalData.room_goods_id){ | |
| 2864 | + newd.room_id=getApp().globalData.room_id; | |
| 2865 | + } | |
| 2866 | + } | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2839 | 2870 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ |
| 2840 | 2871 | |
| 2841 | 2872 | if(th.data.is_normal == 1){ |
| ... | ... | @@ -3189,17 +3220,17 @@ Page({ |
| 3189 | 3220 | //--定义的保存图片方法,分享团--- |
| 3190 | 3221 | saveImageToPhotosAlbum: function() { |
| 3191 | 3222 | //--先判断会员状态-- |
| 3192 | - var user_info = getApp().globalData.userInfo; | |
| 3193 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 3194 | - //getApp().my_warnning("请先登录",0,this); | |
| 3195 | - wx.navigateTo({ url: '/pages/getphone/getphone', }) | |
| 3196 | - return false; | |
| 3197 | - } | |
| 3223 | + // var user_info = getApp().globalData.userInfo; | |
| 3224 | + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 3225 | + // //getApp().my_warnning("请先登录",0,this); | |
| 3226 | + // wx.navigateTo({ url: '/pages/getphone/getphone', }) | |
| 3227 | + // return false; | |
| 3228 | + // } | |
| 3198 | 3229 | |
| 3199 | 3230 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 |
| 3200 | - var type = this.data.prom_type; | |
| 3201 | - if (type == 6) type = 2; | |
| 3202 | - if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; | |
| 3231 | + // var type = this.data.prom_type; | |
| 3232 | + // if (type == 6) type = 2; | |
| 3233 | + // if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; | |
| 3203 | 3234 | |
| 3204 | 3235 | wx.showLoading({ |
| 3205 | 3236 | title: '生成中...', |
| ... | ... | @@ -3224,6 +3255,8 @@ Page({ |
| 3224 | 3255 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
| 3225 | 3256 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; |
| 3226 | 3257 | |
| 3258 | + console.log('xiaochengxu----->',path3); | |
| 3259 | + | |
| 3227 | 3260 | //读取文件成功则OK-- |
| 3228 | 3261 | wx.getImageInfo({ |
| 3229 | 3262 | src: path3, |
| ... | ... | @@ -3252,155 +3285,164 @@ Page({ |
| 3252 | 3285 | //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 |
| 3253 | 3286 | context.setFillStyle("black"); |
| 3254 | 3287 | context.setFontSize(21.3 * unit) |
| 3255 | - th.draw_Text(context, th.data.data.goods_name, | |
| 3256 | - 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); | |
| 3288 | + th.draw_Text(context, th.data.data.goods_name, 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); | |
| 3257 | 3289 | //------产品的价格------- |
| 3258 | - context.setFontSize(23 * unit) | |
| 3259 | - context.setFillStyle("red") | |
| 3260 | - context.fillText("¥", 416 * unit, 185 * unit); | |
| 3261 | - context.setFontSize(31 * unit) | |
| 3262 | - var pri0 = th.data.data.shop_price; | |
| 3263 | - if (th.data.prom_act) | |
| 3264 | - pri0 = th.data.prom_act.price; | |
| 3265 | - | |
| 3266 | - pri0 = parseFloat(pri0).toFixed(2); | |
| 3267 | - context.fillText(pri0, 438 * unit, 185 * unit); | |
| 3290 | + // context.setFontSize(23 * unit) | |
| 3291 | + // context.setFillStyle("red") | |
| 3292 | + // context.fillText("¥", 416 * unit, 185 * unit); | |
| 3293 | + // context.setFontSize(31 * unit) | |
| 3294 | + // var pri0 = th.data.data.shop_price; | |
| 3295 | + // if (th.data.prom_act) | |
| 3296 | + // pri0 = th.data.prom_act.price; | |
| 3297 | + | |
| 3298 | + // pri0 = parseFloat(pri0).toFixed(2); | |
| 3299 | + // context.fillText(pri0, 438 * unit, 185 * unit); | |
| 3268 | 3300 | //---市场价划掉--- |
| 3269 | - context.setFillStyle("gray") | |
| 3270 | - context.setFontSize(22 * unit) | |
| 3271 | - context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit); | |
| 3272 | - context.setStrokeStyle('gray') | |
| 3273 | - context.setLineWidth(1 * unit) | |
| 3274 | - context.moveTo(426 * unit, 206 * unit) | |
| 3275 | - context.lineTo(510 * unit, 206 * unit) | |
| 3276 | - context.stroke(); | |
| 3301 | + // context.setFillStyle("gray") | |
| 3302 | + // context.setFontSize(22 * unit) | |
| 3303 | + // context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit); | |
| 3304 | + // context.setStrokeStyle('gray') | |
| 3305 | + // context.setLineWidth(1 * unit) | |
| 3306 | + // context.moveTo(426 * unit, 206 * unit) | |
| 3307 | + // context.lineTo(510 * unit, 206 * unit) | |
| 3308 | + // context.stroke(); | |
| 3277 | 3309 | //---中间大图--- |
| 3278 | 3310 | context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); |
| 3279 | - //-------大图后面就不一样了----------- | |
| 3280 | - switch (type) { | |
| 3281 | - case 0: //普通商品的展示 | |
| 3282 | - //中间的几个字 | |
| 3283 | - var g_path = "../../../images/share/s_gou.png"; | |
| 3284 | - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3285 | - context.setFillStyle("red") | |
| 3286 | - context.setFontSize(18 * unit) | |
| 3287 | - context.fillText("正品保证", 84 * unit, 690 * unit); | |
| 3288 | - | |
| 3289 | - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3290 | - context.setFillStyle("red") | |
| 3291 | - context.setFontSize(18 * unit) | |
| 3292 | - context.fillText("纯实体店", 246 * unit, 690 * unit); | |
| 3293 | - | |
| 3294 | - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3295 | - context.setFillStyle("red") | |
| 3296 | - context.setFontSize(18 * unit) | |
| 3297 | - context.fillText("官方验证", 420 * unit, 690 * unit); | |
| 3298 | - //---画线--- | |
| 3299 | - context.setLineWidth(1 * unit) | |
| 3300 | - context.moveTo(32 * unit, 710 * unit) | |
| 3301 | - context.lineTo(520 * unit, 710 * unit) | |
| 3302 | - context.stroke(); | |
| 3303 | - //---文字--- | |
| 3304 | - context.setFontSize(22 * unit) | |
| 3305 | - context.setFillStyle("black") | |
| 3306 | - context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); | |
| 3307 | - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); | |
| 3308 | - //---二维吗图--- | |
| 3309 | - context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
| 3310 | - break; | |
| 3311 | - case 1: //秒杀商品的展示 | |
| 3312 | - //---画线--- | |
| 3313 | - context.setLineWidth(1 * unit) | |
| 3314 | - context.moveTo(32 * unit, 670 * unit) | |
| 3315 | - context.lineTo(520 * unit, 670 * unit) | |
| 3316 | - context.stroke(); | |
| 3311 | + | |
| 3312 | + //---文字--- | |
| 3313 | + context.setFontSize(22 * unit) | |
| 3314 | + context.setFillStyle("black") | |
| 3315 | + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); | |
| 3316 | + context.fillText("长按识别小程序码", 40 * unit, 826 * unit); | |
| 3317 | + //---二维吗图--- | |
| 3318 | + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
| 3317 | 3319 | |
| 3318 | - //画秒杀的图片 | |
| 3319 | - var miaos_path = '../../../images/share/miao_share.png'; | |
| 3320 | - context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); | |
| 3321 | 3320 | |
| 3322 | - //---文字--- | |
| 3323 | - context.setFontSize(22 * unit) | |
| 3324 | - context.setFillStyle("black") | |
| 3325 | - context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); | |
| 3326 | - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); | |
| 3327 | - //---二维吗图--- | |
| 3328 | - context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
| 3329 | - break; | |
| 3330 | - | |
| 3331 | - case 2: //会员团和商家团的展示 | |
| 3332 | - //---画线--- | |
| 3333 | - context.setLineWidth(1 * unit) | |
| 3334 | - context.moveTo(32 * unit, 670 * unit) | |
| 3335 | - context.lineTo(520 * unit, 670 * unit) | |
| 3336 | - context.stroke(); | |
| 3337 | - //---文字--- | |
| 3338 | - context.setFontSize(22 * unit) | |
| 3339 | - context.font = 'normal bold'; | |
| 3340 | - context.setFillStyle("black") | |
| 3341 | - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | |
| 3342 | - | |
| 3343 | - //绘制成团图片 | |
| 3344 | - var ct_img = "../../../images/share/ct_num.png"; | |
| 3345 | - context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); | |
| 3346 | - var ct_num = th.data.prom_act.ct_num; | |
| 3347 | - context.setFontSize(14 * unit) | |
| 3348 | - context.font = 'normal'; | |
| 3349 | - context.setFillStyle("red") | |
| 3350 | - if (ct_num < 10) { | |
| 3351 | - context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit); | |
| 3352 | - } else { | |
| 3353 | - context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit); | |
| 3354 | - } | |
| 3355 | - context.setFontSize(22 * unit) | |
| 3356 | - context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit); | |
| 3357 | - context.setFillStyle("gray") | |
| 3358 | - context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit); | |
| 3359 | - context.setFillStyle("black") | |
| 3360 | - context.font = 'normal bold 18px sans-serif'; | |
| 3361 | - context.setFontSize(21.3 * unit) | |
| 3362 | - context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); | |
| 3363 | - //---二维吗图--- | |
| 3364 | - context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | |
| 3365 | - break | |
| 3366 | - case 3: //阶梯团的展示 | |
| 3321 | + //-------大图后面就不一样了----------- | |
| 3322 | + // switch (type) { | |
| 3323 | + // case 0: //普通商品的展示 | |
| 3324 | + //中间的几个字 | |
| 3325 | + // var g_path = "../../../images/share/s_gou.png"; | |
| 3326 | + // context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3327 | + // context.setFillStyle("red") | |
| 3328 | + // context.setFontSize(18 * unit) | |
| 3329 | + // context.fillText("正品保证", 84 * unit, 690 * unit); | |
| 3330 | + | |
| 3331 | + // context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3332 | + // context.setFillStyle("red") | |
| 3333 | + // context.setFontSize(18 * unit) | |
| 3334 | + // context.fillText("纯实体店", 246 * unit, 690 * unit); | |
| 3335 | + | |
| 3336 | + // context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | |
| 3337 | + // context.setFillStyle("red") | |
| 3338 | + // context.setFontSize(18 * unit) | |
| 3339 | + // context.fillText("官方验证", 420 * unit, 690 * unit); | |
| 3367 | 3340 | //---画线--- |
| 3368 | - context.setLineWidth(1 * unit) | |
| 3369 | - context.moveTo(32 * unit, 670 * unit) | |
| 3370 | - context.lineTo(520 * unit, 670 * unit) | |
| 3371 | - context.stroke(); | |
| 3341 | + // context.setLineWidth(1 * unit) | |
| 3342 | + // context.moveTo(32 * unit, 710 * unit) | |
| 3343 | + // context.lineTo(520 * unit, 710 * unit) | |
| 3344 | + // context.stroke(); | |
| 3372 | 3345 | //---文字--- |
| 3373 | - context.setFontSize(22 * unit) | |
| 3374 | - context.font = 'normal bold'; | |
| 3375 | - context.setFillStyle("black") | |
| 3376 | - context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | |
| 3377 | - //---绘制中间阶梯的价格--- | |
| 3378 | - var list = th.data.prom_act.ct_rylist; | |
| 3379 | - for (var i = 0; i < list.length; i++) { | |
| 3380 | - var item = list[i]; | |
| 3381 | - var wi = i * 90 * unit; | |
| 3382 | - context.font = 'normal'; | |
| 3383 | - context.setFontSize(16 * unit) | |
| 3384 | - context.setFillStyle("red") | |
| 3385 | - context.fillText("¥", 40 * unit + wi, 756 * unit); | |
| 3386 | - context.setFontSize(22 * unit) | |
| 3387 | - var pri = parseFloat(item.price).toFixed(2); | |
| 3388 | - context.fillText(pri, 56 * unit + wi, 756 * unit); | |
| 3389 | - context.setFillStyle("gray") | |
| 3390 | - context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); | |
| 3391 | - } | |
| 3392 | - //----------------下面部分---------------- | |
| 3393 | - context.setFillStyle("gray") | |
| 3394 | - context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit); | |
| 3395 | - context.setFillStyle("black") | |
| 3396 | - context.font = 'normal bold 18px sans-serif'; | |
| 3397 | - context.setFontSize(22 * unit) | |
| 3398 | - context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); | |
| 3399 | - //---二维吗图--- | |
| 3400 | - context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | |
| 3401 | - | |
| 3402 | - break | |
| 3403 | - } | |
| 3346 | + // context.setFontSize(22 * unit) | |
| 3347 | + // context.setFillStyle("black") | |
| 3348 | + // context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); | |
| 3349 | + // context.fillText("长按识别小程序码", 40 * unit, 826 * unit); | |
| 3350 | + // //---二维吗图--- | |
| 3351 | + // context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
| 3352 | + // break; | |
| 3353 | + // case 1: //秒杀商品的展示 | |
| 3354 | + // //---画线--- | |
| 3355 | + // context.setLineWidth(1 * unit) | |
| 3356 | + // context.moveTo(32 * unit, 670 * unit) | |
| 3357 | + // context.lineTo(520 * unit, 670 * unit) | |
| 3358 | + // context.stroke(); | |
| 3359 | + | |
| 3360 | + // //画秒杀的图片 | |
| 3361 | + // var miaos_path = '../../../images/share/miao_share.png'; | |
| 3362 | + // context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); | |
| 3363 | + | |
| 3364 | + // //---文字--- | |
| 3365 | + // context.setFontSize(22 * unit) | |
| 3366 | + // context.setFillStyle("black") | |
| 3367 | + // context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); | |
| 3368 | + // context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); | |
| 3369 | + // //---二维吗图--- | |
| 3370 | + // context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
| 3371 | + // break; | |
| 3372 | + | |
| 3373 | + // case 2: //会员团和商家团的展示 | |
| 3374 | + // //---画线--- | |
| 3375 | + // context.setLineWidth(1 * unit) | |
| 3376 | + // context.moveTo(32 * unit, 670 * unit) | |
| 3377 | + // context.lineTo(520 * unit, 670 * unit) | |
| 3378 | + // context.stroke(); | |
| 3379 | + // //---文字--- | |
| 3380 | + // context.setFontSize(22 * unit) | |
| 3381 | + // context.font = 'normal bold'; | |
| 3382 | + // context.setFillStyle("black") | |
| 3383 | + // context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | |
| 3384 | + | |
| 3385 | + // //绘制成团图片 | |
| 3386 | + // var ct_img = "../../../images/share/ct_num.png"; | |
| 3387 | + // context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); | |
| 3388 | + // var ct_num = th.data.prom_act.ct_num; | |
| 3389 | + // context.setFontSize(14 * unit) | |
| 3390 | + // context.font = 'normal'; | |
| 3391 | + // context.setFillStyle("red") | |
| 3392 | + // if (ct_num < 10) { | |
| 3393 | + // context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit); | |
| 3394 | + // } else { | |
| 3395 | + // context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit); | |
| 3396 | + // } | |
| 3397 | + // context.setFontSize(22 * unit) | |
| 3398 | + // context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit); | |
| 3399 | + // context.setFillStyle("gray") | |
| 3400 | + // context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit); | |
| 3401 | + // context.setFillStyle("black") | |
| 3402 | + // context.font = 'normal bold 18px sans-serif'; | |
| 3403 | + // context.setFontSize(21.3 * unit) | |
| 3404 | + // context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); | |
| 3405 | + // //---二维吗图--- | |
| 3406 | + // context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | |
| 3407 | + // break | |
| 3408 | + // case 3: //阶梯团的展示 | |
| 3409 | + // //---画线--- | |
| 3410 | + // context.setLineWidth(1 * unit) | |
| 3411 | + // context.moveTo(32 * unit, 670 * unit) | |
| 3412 | + // context.lineTo(520 * unit, 670 * unit) | |
| 3413 | + // context.stroke(); | |
| 3414 | + // //---文字--- | |
| 3415 | + // context.setFontSize(22 * unit) | |
| 3416 | + // context.font = 'normal bold'; | |
| 3417 | + // context.setFillStyle("black") | |
| 3418 | + // context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | |
| 3419 | + // //---绘制中间阶梯的价格--- | |
| 3420 | + // var list = th.data.prom_act.ct_rylist; | |
| 3421 | + // for (var i = 0; i < list.length; i++) { | |
| 3422 | + // var item = list[i]; | |
| 3423 | + // var wi = i * 90 * unit; | |
| 3424 | + // context.font = 'normal'; | |
| 3425 | + // context.setFontSize(16 * unit) | |
| 3426 | + // context.setFillStyle("red") | |
| 3427 | + // context.fillText("¥", 40 * unit + wi, 756 * unit); | |
| 3428 | + // context.setFontSize(22 * unit) | |
| 3429 | + // var pri = parseFloat(item.price).toFixed(2); | |
| 3430 | + // context.fillText(pri, 56 * unit + wi, 756 * unit); | |
| 3431 | + // context.setFillStyle("gray") | |
| 3432 | + // context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); | |
| 3433 | + // } | |
| 3434 | + // //----------------下面部分---------------- | |
| 3435 | + // context.setFillStyle("gray") | |
| 3436 | + // context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit); | |
| 3437 | + // context.setFillStyle("black") | |
| 3438 | + // context.font = 'normal bold 18px sans-serif'; | |
| 3439 | + // context.setFontSize(22 * unit) | |
| 3440 | + // context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); | |
| 3441 | + // //---二维吗图--- | |
| 3442 | + // context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | |
| 3443 | + | |
| 3444 | + // break | |
| 3445 | + // } | |
| 3404 | 3446 | |
| 3405 | 3447 | //---绘制圆形要放在最后---- |
| 3406 | 3448 | context.save(); | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -479,9 +479,9 @@ |
| 479 | 479 | </block> |
| 480 | 480 | |
| 481 | 481 | |
| 482 | - <view class="bz_view one_elli" wx:if="{{bconfig}}"> | |
| 482 | + <view class="bz_view flex ai-center" wx:if="{{bconfig}}" style="line-height: 36rpx"> | |
| 483 | 483 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> |
| 484 | - <text>{{bconfig.service_bz}}</text> | |
| 484 | + <view>{{bconfig.service_bz}}</view> | |
| 485 | 485 | </view> |
| 486 | 486 | |
| 487 | 487 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
| ... | ... | @@ -947,9 +947,10 @@ left:31rpx;} |
| 947 | 947 | text-overflow: ellipsis;} |
| 948 | 948 | .item_right text{ margin-left: 66rpx;} |
| 949 | 949 | |
| 950 | -.bzfu_img{ width: 164rpx; height:34rpx; position: relative; top: 34rpx; margin-right: 18rpx; margin-left: 12rpx } | |
| 950 | +.bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } | |
| 951 | 951 | .bz_view{ height:100rpx; padding: 0 13rpx; color: #333; font-size: 28rpx; |
| 952 | - border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; line-height: 100rpx } | |
| 952 | + border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; } | |
| 953 | + .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} | |
| 953 | 954 | |
| 954 | 955 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; |
| 955 | 956 | font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } | ... | ... |
pages/index/index/index.wxss
pages/justTest/justTest.js
0 → 100644
| 1 | +// pages/justTest/justTest.js | |
| 2 | +// let livePlayer = requirePlugin('live-player-plugin'); | |
| 3 | + | |
| 4 | + | |
| 5 | +var t = require("../../utils/util.js"), | |
| 6 | + ut = t, | |
| 7 | + e = require("../../utils/common.js"), | |
| 8 | + a = require("../../utils/wxParse/wxParse.js"), | |
| 9 | + s = getApp(), | |
| 10 | + i = s.request, | |
| 11 | + rq = i, | |
| 12 | + oo = s.globalData, | |
| 13 | + o = s.globalData.setting, | |
| 14 | + os = o; | |
| 15 | +var utils = require('../../utils/util.js'),ut=utils; | |
| 16 | +var regeneratorRuntime = require('../../utils/runtime.js'); | |
| 17 | + | |
| 18 | +Page({ | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 页面的初始数据 | |
| 22 | + */ | |
| 23 | + data: { | |
| 24 | + gid: "", | |
| 25 | + stoid: o.stoid, | |
| 26 | + url: o.url, | |
| 27 | + resourceUrl: o.resourceUrl, | |
| 28 | + iurl: o.imghost, | |
| 29 | + defaultAvatar: o.resourceUrl + "/static/images/user68.jpg", | |
| 30 | + data: null, | |
| 31 | + openSpecModal: !1, | |
| 32 | + openPromModal: !1, | |
| 33 | + supportPageScroll: !1, | |
| 34 | + | |
| 35 | + //联系电话 | |
| 36 | + mobile: '', | |
| 37 | + bconfig:null, | |
| 38 | + sales_rules:1, | |
| 39 | + | |
| 40 | + t_time:null, | |
| 41 | + card_field:"", | |
| 42 | + dp_price:0, | |
| 43 | + cut_price:0, | |
| 44 | + open_ind_store:1, | |
| 45 | + goodsInputNum:1, | |
| 46 | + g_buy_num: null, | |
| 47 | + sele_collocation:null, | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + photoUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1003256280,1176261798&fm=26&gp=0.jpg", | |
| 52 | + //(用来控制显示哪个按钮) false表示还没首次进行弹框授权,或者已经授权了;true表示在首次授权弹框时拒绝授权,或者在设置页面还是拒绝了授权 | |
| 53 | + isAuthSavePhoto: false | |
| 54 | + }, | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + sendRequest: function () { | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + //调用接口判断是不是会员 | |
| 65 | + getApp().request.promiseGet("/api/weshop/wx/livelist/page",{ | |
| 66 | + data:{store_id: 1} | |
| 67 | + }).then(res=>{ | |
| 68 | + console.log(res); | |
| 69 | + // if(res.data.code==0){ | |
| 70 | + // getApp().globalData.guide_id=res.data.data.id; | |
| 71 | + // } | |
| 72 | + }) | |
| 73 | + | |
| 74 | + }, | |
| 75 | + // nav: function () { | |
| 76 | + // wx.redirectTo({ | |
| 77 | + // url: '/packageA/pages/liveStream/liveStream' | |
| 78 | + // }) | |
| 79 | + // }, | |
| 80 | + /** | |
| 81 | + * 生命周期函数--监听页面加载 | |
| 82 | + */ | |
| 83 | + onLoad: function (options) { | |
| 84 | + | |
| 85 | + }, | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 生命周期函数--监听页面初次渲染完成 | |
| 89 | + */ | |
| 90 | + onReady: function () { | |
| 91 | + | |
| 92 | + }, | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * 生命周期函数--监听页面显示 | |
| 96 | + */ | |
| 97 | + onShow: function () { | |
| 98 | + | |
| 99 | + }, | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * 生命周期函数--监听页面隐藏 | |
| 103 | + */ | |
| 104 | + onHide: function () { | |
| 105 | + | |
| 106 | + }, | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 生命周期函数--监听页面卸载 | |
| 110 | + */ | |
| 111 | + onUnload: function () { | |
| 112 | + | |
| 113 | + }, | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * 页面相关事件处理函数--监听用户下拉动作 | |
| 117 | + */ | |
| 118 | + onPullDownRefresh: function () { | |
| 119 | + | |
| 120 | + }, | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 页面上拉触底事件的处理函数 | |
| 124 | + */ | |
| 125 | + onReachBottom: function () { | |
| 126 | + | |
| 127 | + }, | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * 用户点击右上角分享 | |
| 131 | + */ | |
| 132 | + onShareAppMessage: function () { | |
| 133 | + | |
| 134 | + }, | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + saveImage() { | |
| 140 | + wx.showLoading({ | |
| 141 | + title: '保存中...', | |
| 142 | + mask: true, | |
| 143 | + }); | |
| 144 | + wx.downloadFile({ | |
| 145 | + url: | |
| 146 | + 'http://upload.jianshu.io/admin_banners/web_images/4435/c1d3ca63353c8bd527f0d781605516cb5b266d02.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/1250/h/540', | |
| 147 | + success: function(res) { | |
| 148 | + if (res.statusCode === 200) { | |
| 149 | + let img = res.tempFilePath; | |
| 150 | + wx.saveImageToPhotosAlbum({ | |
| 151 | + filePath: img, | |
| 152 | + success(res) { | |
| 153 | + wx.showToast({ | |
| 154 | + title: '保存成功', | |
| 155 | + icon: 'success', | |
| 156 | + duration: 2000 | |
| 157 | + }); | |
| 158 | + }, | |
| 159 | + fail(res) { | |
| 160 | + wx.showToast({ | |
| 161 | + title: '保存失败', | |
| 162 | + icon: 'success', | |
| 163 | + duration: 2000 | |
| 164 | + }); | |
| 165 | + } | |
| 166 | + }); | |
| 167 | + } | |
| 168 | + } | |
| 169 | + }); | |
| 170 | + }, | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + live() {} | |
| 175 | + | |
| 176 | + | |
| 177 | +}) | |
| 0 | 178 | \ No newline at end of file | ... | ... |
pages/justTest/justTest.json
0 → 100644
pages/justTest/justTest.wxml
0 → 100644
| 1 | +<!--pages/justTest/justTest.wxml--> | |
| 2 | +<text>pages/justTest/justTest.wxml</text> | |
| 3 | +<navigator url="/packageA/pages/liveStream/liveStream">进入直播</navigator> | |
| 4 | +<navigator url="/packageA/pages/liveStreamDetails/liveStreamDetails">进入直播详情页</navigator> | |
| 5 | +<button bindtap="sendRequest">发送请求</button> | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | +<button open-type="share" class='iconfont icon-weixin'>分享</button> | |
| 11 | +<button bindopensetting="onOpenSetting" open-type="openSetting" > | |
| 12 | + 保存图片到手机 | |
| 13 | +</button> | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | +<view class="box"> | |
| 20 | + <image class="img" src="{{photoUrl}}" bindtap='onPreviewImage'></image> | |
| 21 | + <view class="btn"> | |
| 22 | + <button bindtap="onSaveToPhone" class="btn button-hover"> | |
| 23 | + 保存图片到手机1 | |
| 24 | + </button> | |
| 25 | + <!-- <button wx:else bind:tap="showModal" class="btn button-hover" > | |
| 26 | + 保存图片到手机2 | |
| 27 | + </button> --> | |
| 28 | + <!-- 我们不使用点击按钮即打开设置页面的方式,而是使用上面那种先显示提示框让用户点确定按钮后再打开设置页面 --> | |
| 29 | + <!-- <button wx:else bind:opensetting="onOpenSetting" open-type="openSetting" class="btn button-hover" > | |
| 30 | + 保存二维码到手机 | |
| 31 | + </button> --> | |
| 32 | + </view> | |
| 33 | +</view> | |
| 34 | + | |
| 35 | +<button bindtap="saveImage">savepics</button> | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | +<!-- 直播组件 - --> | |
| 40 | +<!-- <subscribe room-id="1"></subscribe> --> | |
| 41 | + | |
| 42 | +<open-data type="userAvatarUrl"></open-data> | |
| 43 | +<open-data type="userNickName"></open-data> | |
| 44 | + | |
| 45 | + | |
| 46 | + | ... | ... |
pages/justTest/justTest.wxss
0 → 100644
| 1 | +/* pages/justTest/justTest.wxss */ | |
| 2 | +page { | |
| 3 | + background: #fff; | |
| 4 | + text-align: center; | |
| 5 | +} | |
| 6 | + | |
| 7 | +.box { | |
| 8 | + padding: 30rpx 80rpx; | |
| 9 | +} | |
| 10 | + | |
| 11 | +.img { | |
| 12 | + width: 430rpx; | |
| 13 | + height: 430rpx; | |
| 14 | + margin: 20rpx 0; | |
| 15 | +} | |
| 16 | +button { | |
| 17 | + width: 100%; | |
| 18 | + background: #ffffff; | |
| 19 | + border: none; | |
| 20 | + border-radius: 0rpx; | |
| 21 | + padding: 0; | |
| 22 | + margin: 0; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.btn { | |
| 26 | + background: green; | |
| 27 | + color: #ffffff; | |
| 28 | + border-radius: 0; | |
| 29 | +} | |
| 0 | 30 | \ No newline at end of file | ... | ... |
pages/store/index.js
| ... | ... | @@ -12,6 +12,7 @@ Page({ |
| 12 | 12 | is_no_more:0, |
| 13 | 13 | key_word:'', //关键字搜索 |
| 14 | 14 | cat_id:0, //分类ID |
| 15 | + islading:0, | |
| 15 | 16 | }, |
| 16 | 17 | |
| 17 | 18 | onShow:function(){ |
| ... | ... | @@ -65,6 +66,8 @@ Page({ |
| 65 | 66 | |
| 66 | 67 | get_list:function(){ |
| 67 | 68 | if(this.data.is_no_more==1) return false; |
| 69 | + if(this.data.islading==1) return false; | |
| 70 | + this.data.islading=1; | |
| 68 | 71 | var th=this,req = getApp().request; |
| 69 | 72 | var dd = { |
| 70 | 73 | store_id: o.stoid, |
| ... | ... | @@ -84,6 +87,7 @@ Page({ |
| 84 | 87 | req.promiseGet("/api/weshop/pickup/list", { |
| 85 | 88 | data: dd, |
| 86 | 89 | }).then(res => { |
| 90 | + this.data.islading=0; | |
| 87 | 91 | wx.hideLoading(); |
| 88 | 92 | if(res.data.code==0){ |
| 89 | 93 | if(res.data.data.pageData.length<=0){ |
| ... | ... | @@ -132,6 +136,7 @@ Page({ |
| 132 | 136 | cid: item['cat_id'] |
| 133 | 137 | }) |
| 134 | 138 | this.data.page=1; |
| 139 | + this.data.is_no_more=0; | |
| 135 | 140 | this.setData({ pick_list:null}) |
| 136 | 141 | this.get_list(); |
| 137 | 142 | |
| ... | ... | @@ -139,7 +144,8 @@ Page({ |
| 139 | 144 | |
| 140 | 145 | //搜索关键字 |
| 141 | 146 | sear:function(){ |
| 142 | - this.data.page=1; | |
| 147 | + this.data.page=1; | |
| 148 | + this.data.is_no_more=0; | |
| 143 | 149 | this.setData({ pick_list:null}) |
| 144 | 150 | this.get_list(); |
| 145 | 151 | }, | ... | ... |
pages/store/index.wxml
| 1 | 1 | <view class="bcolor flex jc_sb"> |
| 2 | - <view class="sear_inp"> | |
| 2 | + <view class="sear_inp flex ai-center"> | |
| 3 | 3 | <view class="sear_btn" bindtap='sear'> |
| 4 | 4 | <image src="{{url}}/miniapp/images/search.png" style="width: 30rpx; height: 30rpx; margin-left: 10rpx;"></image> |
| 5 | - </view> | |
| 5 | + </view> | |
| 6 | 6 | <input bindinput ="lose_focus" class="fs28" value=""/> |
| 7 | 7 | </view> |
| 8 | 8 | <view class="select"> | ... | ... |
pages/store/index.wxss
| ... | ... | @@ -42,7 +42,7 @@ position: relative; |
| 42 | 42 | .bcolor{background-color: #f5f5f5; height: 126rpx;} |
| 43 | 43 | |
| 44 | 44 | .sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;} |
| 45 | -.sear_inp input{ position: relative; top:10rpx;width: 400rpx; display: inline-block;} | |
| 45 | +.sear_inp input{width: 400rpx;} | |
| 46 | 46 | .select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center } |
| 47 | -.sear_btn{ width: 50rpx; height: 100%; display: inline-block;} | |
| 47 | +.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;} | |
| 48 | 48 | ... | ... |
pages/user/assistance/friend_assistance.js
| ... | ... | @@ -126,7 +126,8 @@ Page({ |
| 126 | 126 | id: this.data.tasking, |
| 127 | 127 | storeId: os.stoid, |
| 128 | 128 | userId: this.data.userId, |
| 129 | - zlUserId: t_user_id | |
| 129 | + zlUserId: t_user_id, | |
| 130 | + isWeappUser:1, //是不是小程序的入口,不需要判断 | |
| 130 | 131 | }; |
| 131 | 132 | console.log(data); |
| 132 | 133 | getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert", | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -92,12 +92,33 @@ |
| 92 | 92 | |
| 93 | 93 | </view> |
| 94 | 94 | <view class="xc-after-sale rel"> |
| 95 | + <!-- 顶上的一栏 --> | |
| 96 | + <view class="xc-equity-title flex-level" bindtap="go_order" data-url="/pages/user/order_list/order_list"> | |
| 97 | + <view class="xc-title-frame flex-space-between"> | |
| 98 | + <view class="flex-vertical xc-title-content"> | |
| 99 | + <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image> | |
| 100 | + <view class="three-level-word">我的订单</view> | |
| 101 | + </view> | |
| 102 | + </view> | |
| 103 | + <view class="three-level-word xc-more-frame flex-vertical"> | |
| 104 | + <view class="three-level-word xc-more">更多</view> | |
| 105 | + <view class="bg_right xc-more-click bcolor"></view> | |
| 106 | + </view> | |
| 107 | + </view> | |
| 108 | + <!-- 内容的一栏 --> | |
| 95 | 109 | <view class="xc-after-sale-left flex-center-around"> |
| 96 | 110 | <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=1"> |
| 97 | 111 | <image class="xc-no-money" src="{{iurl}}/miniapp/images/daifuk.png"></image> |
| 98 | 112 | <view class=" xc-word-color four-level-word">待付款</view> |
| 99 | 113 | <text class="order-num" hidden='{{toji.wait_pay>0?"":"true"}}'>{{toji.wait_pay}}</text> |
| 100 | 114 | </view> |
| 115 | + | |
| 116 | + <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=2"> | |
| 117 | + <image class="xc-send" src="{{iurl}}/miniapp/images/dfahuo.png?v=1"></image> | |
| 118 | + <view class="xc-word-color four-level-word">待发货</view> | |
| 119 | + <text class="order-num" hidden='{{toji.wait_receive>0?"":"true"}}'>{{toji.wait_send}}</text> | |
| 120 | + </view> | |
| 121 | + | |
| 101 | 122 | <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=3"> |
| 102 | 123 | <image class="xc-await" src="{{iurl}}/miniapp/images/shouhuo1.png"></image> |
| 103 | 124 | <view class="xc-word-color four-level-word">待收货</view> |
| ... | ... | @@ -115,15 +136,8 @@ |
| 115 | 136 | <!--<text class="order-num" hidden='{{toji.wait_return>0>0?"":"true"}}' style="right: -20rpx">{{toji.wait_return}}</text>--> |
| 116 | 137 | </view> |
| 117 | 138 | |
| 118 | - <view class='xc-hump abs'></view> | |
| 119 | - <view class="flex-verticalr xc-after-sale-right"> | |
| 120 | - <view class=" xc-order t-c" bindtap="go_order" data-url="/pages/user/order_list/order_list"> | |
| 121 | - <image class="xc-no-money xc-my-order" src="{{iurl}}/miniapp/images/dindan.png"></image> | |
| 122 | - <view class="xc-word-color four-level-word" style='margin-left:20rpx;'>我的订单</view> | |
| 123 | - </view> | |
| 124 | - </view> | |
| 125 | - | |
| 126 | 139 | </view> |
| 140 | + <view style="clear: both"></view> | |
| 127 | 141 | |
| 128 | 142 | </view> |
| 129 | 143 | |
| ... | ... | @@ -133,9 +147,7 @@ |
| 133 | 147 | <view class="xc-title-frame flex-space-between"> |
| 134 | 148 | <view class="flex-vertical xc-title-content"> |
| 135 | 149 | <image class="xc-title-img" src="{{iurl}}/miniapp/images/medal.png"></image> |
| 136 | - <view class="three-level-word"> | |
| 137 | - 我的权益 | |
| 138 | - </view> | |
| 150 | + <view class="three-level-word">我的权益</view> | |
| 139 | 151 | </view> |
| 140 | 152 | </view> |
| 141 | 153 | <view class="three-level-word xc-more-frame flex-vertical"> |
| ... | ... | @@ -143,6 +155,7 @@ |
| 143 | 155 | <view class="bg_right xc-more-click bcolor"></view> |
| 144 | 156 | </view> |
| 145 | 157 | </view> |
| 158 | + | |
| 146 | 159 | <view class="xc-specific-more-frame flex-vertical"> |
| 147 | 160 | |
| 148 | 161 | <view bindtap="click_pre"> |
| ... | ... | @@ -178,14 +191,14 @@ |
| 178 | 191 | </block> |
| 179 | 192 | |
| 180 | 193 | <!-- 工具与服务 --> |
| 181 | - <view class="xc-tool-service"> | |
| 194 | + <view class="xc-tool-service" > | |
| 182 | 195 | <view class="xc-tool-service-title flex-vertical"> |
| 183 | 196 | <image class="xc-tool-service-img" src="{{iurl}}/miniapp/images/gj.png"></image> |
| 184 | 197 | <view class="three-level-word xc-tool-service-word">工具与服务</view> |
| 185 | 198 | </view> |
| 186 | 199 | <view class="xc-project-frame"> |
| 187 | 200 | <!-- 跳转页面 --> |
| 188 | - <view class="center_v"> | |
| 201 | + <view class="center_v" style="display: flex;flex-wrap: wrap;align-items: center;"> | |
| 189 | 202 | <view class="item t-c" data-url="/pages/team/team_ping/team_ping" bindtap="goto"> |
| 190 | 203 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/pindan.png"></image> |
| 191 | 204 | <view class="fs26">我的拼单</view> | ... | ... |
pages/user/index/index.wxss
| ... | ... | @@ -202,13 +202,14 @@ |
| 202 | 202 | |
| 203 | 203 | .xc-after-sale { |
| 204 | 204 | width: 100%; |
| 205 | - height: 160rpx; | |
| 206 | 205 | border-bottom: 10px solid #f2f2f2; |
| 207 | 206 | } |
| 208 | 207 | |
| 209 | 208 | .xc-after-sale-left { |
| 210 | - width: 90%; | |
| 209 | + width: 96%; | |
| 211 | 210 | height: 100%; |
| 211 | + margin-top: 40rpx; | |
| 212 | + margin-bottom: 25rpx; | |
| 212 | 213 | } |
| 213 | 214 | |
| 214 | 215 | .xc-no-money { |
| ... | ... | @@ -300,6 +301,11 @@ |
| 300 | 301 | height: 50rpx; |
| 301 | 302 | } |
| 302 | 303 | |
| 304 | +.xc-send{ | |
| 305 | + width: 50rpx; | |
| 306 | + height: 50rpx; | |
| 307 | +} | |
| 308 | + | |
| 303 | 309 | .xc-more-click { |
| 304 | 310 | width: 15rpx; |
| 305 | 311 | height: 15rpx; | ... | ... |
pages/user/userinfo/userinfo.js
utils/auth.js
| ... | ... | @@ -51,6 +51,7 @@ module.exports = { |
| 51 | 51 | data: { |
| 52 | 52 | js_code: e, |
| 53 | 53 | store_id: a.globalData.setting.stoid, |
| 54 | + nickname:a.globalData.getu.nickName, | |
| 54 | 55 | }, |
| 55 | 56 | success: function (e) { |
| 56 | 57 | console.log("openidandkey"); |
| ... | ... | @@ -90,6 +91,7 @@ module.exports = { |
| 90 | 91 | data: { |
| 91 | 92 | js_code: e, |
| 92 | 93 | store_id: a.globalData.setting.stoid, |
| 94 | + nickname:a.globalData.getu.nickName, | |
| 93 | 95 | }, |
| 94 | 96 | success: function (e) { |
| 95 | 97 | console.log("openidandkey"); | ... | ... |
utils/myUtils.wxs
0 → 100644
| 1 | +var myUtils = { | |
| 2 | + // 判断直播状态 | |
| 3 | + liveStatus: function (statusCode) { | |
| 4 | + var statusText; | |
| 5 | + switch(statusCode) { | |
| 6 | + case '101': { | |
| 7 | + statusText = '直播中'; | |
| 8 | + break; | |
| 9 | + } | |
| 10 | + case '102': { | |
| 11 | + statusText = '未开始'; | |
| 12 | + break; | |
| 13 | + } | |
| 14 | + case '103': { | |
| 15 | + statusText = '已结束'; | |
| 16 | + break; | |
| 17 | + } | |
| 18 | + case '104': { | |
| 19 | + statusText = '禁播'; | |
| 20 | + break; | |
| 21 | + } | |
| 22 | + case '105': { | |
| 23 | + statusText = '暂停中'; | |
| 24 | + break; | |
| 25 | + } | |
| 26 | + case '106': { | |
| 27 | + statusText = '异常'; | |
| 28 | + break; | |
| 29 | + } | |
| 30 | + case '107': { | |
| 31 | + statusText = '已过期'; | |
| 32 | + break; | |
| 33 | + } | |
| 34 | + default: break; | |
| 35 | + } | |
| 36 | + return statusText; | |
| 37 | + } | |
| 38 | +}; | |
| 39 | + | |
| 40 | +module.exports = { | |
| 41 | + liveStatus: myUtils.liveStatus | |
| 42 | +} | |
| 0 | 43 | \ No newline at end of file | ... | ... |