diff --git a/app.js b/app.js
index 17fcaf6..def8269 100644
--- a/app.js
+++ b/app.js
@@ -11,6 +11,7 @@ App({
//使用getCurrentPages可以获取当前加载中所有的页面对象的一个数组,数组最后一个就是当前页面。
var custum_data=this.globalData.custum_data;
var isIpx=this.globalData.isIpx;
+ var is_read=this.globalData.is_read;
//var curPageArr = getCurrentPages(); //获取加载的页面
//var curPage = curPageArr[curPageArr.length - 1]; //获取当前页面的对象
var curPage=th;
@@ -18,7 +19,7 @@ App({
if (pagePath.indexOf('/') != 0) {
pagePath = '/' + pagePath;
}
- if(isIpx){
+ if(is_read){
if(custum_data){
that.set_custom_nav(custum_data,isIpx,pagePath,url,curPage);
}else{
@@ -49,10 +50,32 @@ App({
that.globalData.isIpx=isIpx;
getApp().request.promiseGet("/api/weshop/storeFooter/get/"+stoid, {
}).then(res => {
+ this.globalData.is_read=true;
var e = res;
if(e.data.code != -1){
that.globalData.custum_data=e.data.data;
- that.set_custom_nav(e.data.data,isIpx,pagePath,url,curPage);
+
+ var itemList = that.globalData.custum_data.data;
+ itemList = JSON.parse(itemList)
+
+ if(!itemList[0].weappurl){
+ that.globalData.custum_data=null;
+ var tabBar = {
+ 'iscustom':2,
+ 'url':url,
+ 'active':pagePath,
+ 'isIpx':isIpx,
+ cartGoodsNum:this.globalData.cartGoodsNum
+ }
+ curPage.setData({
+ tabBar:tabBar,
+ isIpx:isIpx,
+ cartGoodsNum:this.globalData.cartGoodsNum
+ })
+ }else{
+ that.set_custom_nav(e.data.data,isIpx,pagePath,url,curPage);
+ }
+
}else{
var tabBar = {
'iscustom':2,
@@ -136,7 +159,10 @@ App({
first_leader:null, //分享会员ID
guide_id:null, //分享导购ID
- windowWidth:0, //整个窗体的宽度
+ windowWidth:0, //整个窗体的宽度
+
+ room_id:null, //直播间分享的房间ID
+ room_goods_id:null, //直播间分享的商品ID
},
auth: o,
@@ -563,9 +589,11 @@ App({
//清空登录时候缓存的值
onHide:function () {
this.globalData.is_test=0;
- this.globalData.guide_id=null; //导购清空
- this.globalData.first_leader=null; //分享的会员清空
- th.globalData.wuliu=null; //关闭要把物流清空
+ this.globalData.guide_id=null; //导购清空
+ this.globalData.first_leader=null; //分享的会员清空
+ this.globalData.wuliu=null; //关闭要把物流清空
+ this.globalData.room_id=null; //关闭要把房间号关闭
+ this.globalData.room_goods_id=null; //关闭要把物流清空
}
diff --git a/app.json b/app.json
index 83e2937..06d4421 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,7 @@
{
"pages": [
"pages/index/index/index",
+ "pages/justTest/justTest",
"pages/goods/categoryList/categoryList",
"pages/cart/cart/cart",
"pages/cart/cart2/cart2",
@@ -85,23 +86,24 @@
"pages/video/index",
"pages/template/index",
"pages/store/index"
-
],
-
+ "plugins": {
+ "live-player-plugin": {
+ "version": "1.1.1",
+ "provider": "wx2b03c6e691cd7370"
+ }
+ },
"subPackages": [{
"root": "packageA/",
"name":"pack1",
- "pages": [
+ "pages": [
"pages/prom_list/prom_list",
"pages/quan_list/quan_list",
- "pages/quan_pro/quan_pro"
- ],
- "plugins": {
- "live-player-plugin": {
- "version": "1.0.13",
- "provider": "wx2b03c6e691cd7370"
- }
- }
+ "pages/quan_pro/quan_pro",
+ "pages/liveStream/liveStream",
+ "pages/liveStreamDetails/liveStreamDetails"
+ ]
+
}],
"permission": {
diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js
index 7f4bcb7..b5f9507 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.js
+++ b/components/diy_goodsGroup/diy_goodsGroup.js
@@ -83,39 +83,10 @@ Component({
},
pageLifetimes: {
+ //游客登陆后,只要更新卡的情况
show: function () {
- this.data.firist_type_curr=0,
- this.data.currentPage=1,
- this.setData({ goods_array: null})
-
- // 页面被展示
- // 在组件实例进入页面节点树时执行
- this.data.classstyle_id = this.data.object.classstyle;
- this.data.goodscount = this.data.object.goodscount;
- this.data.wgroup = this.data.object.wgroup;
-
- this.setData({
- classstyle_id: this.data.object.classstyle
- })
- if (this.data.object.goodsclass == 1) {
- this.data.is_recommend = 1
- }
- if (this.data.object.goodsclass == 2) {
- this.data.is_hot = 1
- }
- if (this.data.object.goodsclass == 3) {
- this.data.is_new = 1
- }
- this.data.requestData = new Array();
- //---将数组---
- this.data.g_id = this.data.object.data;
- var arr = [];
- for (var i = 0; i < this.data.g_id .length; i += this.data.goodscount) {
- arr.push(this.data.g_id .slice(i, i + this.data.goodscount));
- }
-
- this.data.firist_type_data = arr;
- this.init(this.data.classstyle_id, this.data.wgroup);
+ //--初始化卡类--
+ this.card_init();
},
},
@@ -178,16 +149,18 @@ Component({
break;
case "2":
var item = {};
+ var r_data={
+ store_id: os.stoid ,
+ pageSize: th.data.goodscount,
+ page: th.data.currentPage,
+ isonsale: 1,
+ };
+ if(th.data.is_recommend) r_data.is_recommend=th.data.is_recommend;
+ if(th.data.is_hot) r_data.is_hot=th.data.is_hot;
+ if(th.data.is_new) r_data.is_new=th.data.is_new;
+
app.request.promiseGet("/api/weshop/goods/page", {
- data: {
- store_id: os.stoid ,
- is_recommend: th.data.is_recommend,
- is_hot: th.data.is_hot,
- is_new: th.data.is_new,
- pageSize: th.data.goodscount,
- page: th.data.currentPage,
- isonsale: 1,
- }
+ data:r_data
}).then(res => {
//商品地址
var goods = res.data.data.pageData;
diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml
index 86cd51d..ce71705 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.wxml
+++ b/components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -149,7 +149,7 @@
-
@@ -285,7 +285,7 @@
-
@@ -422,7 +422,7 @@
-
diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxss b/components/diy_goodsGroup/diy_goodsGroup.wxss
index 0ead973..aeb3a85 100644
--- a/components/diy_goodsGroup/diy_goodsGroup.wxss
+++ b/components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -145,6 +145,7 @@
height: 318rpx;
margin-top: 20rpx;
display: flex;
+ position: relative;
}
.zs_t_img_x {
@@ -236,7 +237,7 @@
height: 56rpx;
position: relative;
right: 56rpx;
- top: 234rpx;
+ top: 0rpx;
}
.zs_t1_x3 {
@@ -473,6 +474,13 @@
left: 0rpx;
top: 10rpx;
}
+.zs_t1_x4{
+ width: 56rpx;
+ height: 56rpx;
+ position: absolute;
+ right: 0rpx;
+ bottom: 10rpx;
+}
.zs_t2_3l {
width: 56rpx;
@@ -562,3 +570,5 @@
overflow: hidden;
white-space: nowrap;
}
+
+
diff --git a/components/diy_picMax/diy_picMax.wxss b/components/diy_picMax/diy_picMax.wxss
index 8886b2d..2e26ca6 100644
--- a/components/diy_picMax/diy_picMax.wxss
+++ b/components/diy_picMax/diy_picMax.wxss
@@ -1,7 +1,7 @@
.picMax{width: 100%;position: relative;}
.pic_item{display: block; top:0;left:0;float:left}
-.pic_item image{width: 100%; height: 100%}
-.width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:748rpx;}
+.pic_item image{width: 100%; height: 100%; vertical-align: bottom;}
+.width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:750rpx;}
/* .height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;} */
/* .mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;}
.mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;} */
diff --git a/components/diy_searchbox/diy_searchbox.wxml b/components/diy_searchbox/diy_searchbox.wxml
index cb77060..2ce8ff1 100644
--- a/components/diy_searchbox/diy_searchbox.wxml
+++ b/components/diy_searchbox/diy_searchbox.wxml
@@ -10,7 +10,7 @@
-
+
@@ -26,7 +26,7 @@
- 在店铺内搜索
+ 在店铺内搜索
diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js
index 60e5404..b436a56 100644
--- a/components/goods_list/goods_list.js
+++ b/components/goods_list/goods_list.js
@@ -23,6 +23,13 @@ Component({
},
ready: function () {
},
+ pageLifetimes:{
+ //要处理一下,游客登陆后的界面的变化,主要还该是改变会员
+ show: function () {
+ this.init();
+ }
+ },
+
methods: {
init: function () {
var th = this;
diff --git a/packageA/images/index/tuangou-pic.jpg b/packageA/images/index/tuangou-pic.jpg
new file mode 100644
index 0000000..36eee5d
--- /dev/null
+++ b/packageA/images/index/tuangou-pic.jpg
diff --git a/packageA/images/liveStreamDetails/circle.jpg b/packageA/images/liveStreamDetails/circle.jpg
new file mode 100644
index 0000000..03ac38f
--- /dev/null
+++ b/packageA/images/liveStreamDetails/circle.jpg
diff --git a/packageA/images/liveStreamDetails/cover.jpg b/packageA/images/liveStreamDetails/cover.jpg
new file mode 100644
index 0000000..7514369
--- /dev/null
+++ b/packageA/images/liveStreamDetails/cover.jpg
diff --git a/packageA/images/liveStreamDetails/friend.jpg b/packageA/images/liveStreamDetails/friend.jpg
new file mode 100644
index 0000000..2cc79d3
--- /dev/null
+++ b/packageA/images/liveStreamDetails/friend.jpg
diff --git a/packageA/images/liveStreamDetails/goods.jpg b/packageA/images/liveStreamDetails/goods.jpg
new file mode 100644
index 0000000..5cf5ab5
--- /dev/null
+++ b/packageA/images/liveStreamDetails/goods.jpg
diff --git a/packageA/images/liveStreamDetails/home.jpg b/packageA/images/liveStreamDetails/home.jpg
new file mode 100644
index 0000000..172dac0
--- /dev/null
+++ b/packageA/images/liveStreamDetails/home.jpg
diff --git a/packageA/images/liveStreamDetails/playbill.jpg b/packageA/images/liveStreamDetails/playbill.jpg
new file mode 100644
index 0000000..3fe65e7
--- /dev/null
+++ b/packageA/images/liveStreamDetails/playbill.jpg
diff --git a/packageA/images/liveStreamDetails/save.jpg b/packageA/images/liveStreamDetails/save.jpg
new file mode 100644
index 0000000..562f648
--- /dev/null
+++ b/packageA/images/liveStreamDetails/save.jpg
diff --git a/packageA/images/liveStreamDetails/share.jpg b/packageA/images/liveStreamDetails/share.jpg
new file mode 100644
index 0000000..c1b29c7
--- /dev/null
+++ b/packageA/images/liveStreamDetails/share.jpg
diff --git a/packageA/pages/liveStream/liveStream.js b/packageA/pages/liveStream/liveStream.js
new file mode 100644
index 0000000..471f96b
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.js
@@ -0,0 +1,138 @@
+// pages/liveStream/liveStream.js
+
+var t = require("../../../utils/util"),
+ ut = t,
+ e = require("../../../utils/common.js"),
+ a = require("../../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+var utils = require('../../../utils/util.js'),ut=utils;
+var regeneratorRuntime = require('../../../utils/runtime.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ goodsList: [],
+ imghost: '',
+ liveList: {}
+ },
+
+ // 点击直播列表项
+ clickItem: function (e) {
+ // id:列表项id
+ // live:直播类别 即将开始/直播中/精彩回放
+ wx.navigateTo({
+ url: '/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + e.currentTarget.dataset.id + '&live=' + e.currentTarget.dataset.live
+ })
+ console.log('options-->');
+ },
+
+ // 点击 订阅/观看直播/观看回放 按钮,跳转直播组件
+ clickLive: function (e) {
+ console.log('当前房间号roomid:',e.currentTarget.dataset.roomid);
+ let roomId = e.currentTarget.dataset.roomid;
+ let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 }));
+ wx.navigateTo({
+ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}&custom_params=${customParams}`
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var live = {};
+ live.toBegin = []; // 即将开始
+ live.ing = []; // 直播中
+ live.over = []; // 已结束
+
+ // 请求数据
+ var that = this;
+ getApp().request.promiseGet("/api/weshop/wx/livelist/page", {}).then(res=>{
+ console.log('ressss--->',res);
+ if(res.data.code==0){
+ that.setData({
+ goodsList: res.data.data.pageData
+ })
+ }
+ // console.log(goodsList);
+
+ var result = res.data.data.pageData;
+ var liveStatus;
+ if(res.data.code == 0) {
+ for(var i in result) {
+ console.log(i + '当前直播状态:', result[i].live_status);
+ liveStatus = result[i].live_status;
+ // 这里只显示101/102/103状态
+ if (liveStatus == '101') {
+ live.ing.push(result[i]);
+ } else if (liveStatus == '102') {
+ live.toBegin.push(result[i]);
+ } else if (liveStatus == '103') {
+ live.over.push(result[i]);
+ }
+ }
+ // console.log('live--->', live);
+ that.setData({
+ live
+ });
+ }
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ }
+})
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.json b/packageA/pages/liveStream/liveStream.json
new file mode 100644
index 0000000..e54bca5
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "subscribe": "plugin-private://wx2b03c6e691cd7370/components/subscribe/subscribe"
+ },
+ "navigationBarTitleText": "直播"
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.wxml b/packageA/pages/liveStream/liveStream.wxml
new file mode 100644
index 0000000..ee02d20
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.wxml
@@ -0,0 +1,66 @@
+
+
+
+ 当前暂无直播
+
+
+ 即将开始
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 直播中
+
+
+
+
+
+
+
+ {{item.name}}
+ 观看直播
+
+
+
+
+
+
+
+
+
+ 精彩回放
+
+
+
+
+
+
+
+ {{item.name}}
+ 观看回放
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packageA/pages/liveStream/liveStream.wxss b/packageA/pages/liveStream/liveStream.wxss
new file mode 100644
index 0000000..af00582
--- /dev/null
+++ b/packageA/pages/liveStream/liveStream.wxss
@@ -0,0 +1,95 @@
+/* pages/liveStream/liveStream.wxss */
+.title {
+ font-size: 30rpx;
+ padding: 50rpx 32rpx;
+}
+.list-item {
+ padding: 0 32rpx 30rpx;
+ display: flex;
+}
+.list-item-left {
+ position: relative;
+ width: 300rpx;
+ height: 300rpx;
+ flex-shrink: 0;
+}
+.list-item-right {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding-left: 32rpx;
+ /* position: relative;
+ padding-bottom: 70rpx; */
+}
+.item-pic {
+ /* width: 400rpx; */
+ width: 100%;
+ height: 100%;
+ background-color: #eee;
+}
+.item-desc {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ background: black;
+ color: #fff;
+ text-align: center;
+ padding-bottom: 23rpx;
+
+ background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/
+ background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/
+ background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/
+ background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/
+}
+.item-desc view:first-child {
+ font-size: 24rpx;
+ font-weight: bold;
+}
+.item-desc view:last-child {
+ font-size: 17rpx;
+}
+.item-title {
+ font-weight: bold;
+ font-size: 30rpx;
+ text-align: justify;
+
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 4;
+ overflow: hidden;
+}
+
+.item-btn {
+ width: 172rpx;
+ height: 56rpx;
+ line-height: 56rpx;
+ background-color: #f23030;
+ color: #fff;
+ font-size: 28rpx;
+ text-align: center;
+}
+subscribe {
+ position: relative;
+}
+.subscribe--live-player-subscribe__btn {
+ width: 172rpx !important;
+ height: 56rpx !important;
+ line-height: 56rpx !important;
+ background-color: #f23030 !important;
+ font-size: 28rpx !important;
+ position: relative;
+ border-radius: 0 !important;
+ margin: 0 !important;
+}
+.subscribe--live-player-notSubscribe::before {
+ content: '订阅';
+ position: absolute;
+ left: 0;
+ width: 172rpx;
+ height: 56rpx;
+ background-color: #f23030;
+ color: #fff;
+}
+.subscribe--live-player-hasSubscribe {
+ background-color: #666 !important;
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js
new file mode 100644
index 0000000..cfc2011
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js
@@ -0,0 +1,502 @@
+// pages/liveStreamDetails/liveStreamDetails.js
+var t = require("../../../utils/util.js"),
+ ut = t,
+ e = require("../../../utils/common.js"),
+ a = require("../../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+
+const app = getApp();
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ details: {},
+ status: '',
+ btnText: '',
+ showActionSheet: true,
+ showPlaybill: true,
+ windowWidth: 0,
+ windowHeight: 0,
+ dpr: 0,
+ canvasScale: 1.0,
+ nickName: '',
+ avatarUrl: '',
+ coverImg: '',
+ canvasToImgPath: ''
+ },
+
+ // 点击商品
+ clickgoods: function (e) {
+ console.log('...........>', e.currentTarget.dataset.url);
+ wx.navigateTo({
+ url: '../../../' + e.currentTarget.dataset.url
+ });
+ },
+
+ // 返回首页
+ backHome: function () {
+ wx.reLaunch({
+ url: '../../../pages/index/index/index',
+ })
+ },
+
+ // 分享操作表
+ clickShare: function () {
+ this.setData({
+ showActionSheet: !this.data.showActionSheet
+ })
+ },
+
+ // actionSheet - 取消按钮
+ hiddenActionSheet: function () {
+ this.setData({
+ showActionSheet: 'false'
+ })
+ },
+
+ //生成海报
+ createPlaybill: function () {
+ // 1.提示 “正在生成海报...”
+ wx.showLoading({
+ title: '正在生成海报...'
+ });
+ // 2.生成海报,如果生成完毕,关闭提示
+ this.drawPlaybill();
+ // 3.展示生成的海报
+ this.setData({
+ showPlaybill: !this.data.showPlaybill,
+ showActionSheet: 'false'
+ });
+ },
+
+ // 获取设备信息
+ getSystemInfo: function() {
+ let that = this;
+ wx.getSystemInfo({
+ success: function(res) {
+ that.setData({
+ windowWidth: res.windowWidth,
+ windowHeight: res.windowHeight,
+ dpr: res.pixelRatio
+ })
+ }
+ });
+ },
+
+ //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
+ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
+ var lineWidth = 0;
+ var lastSubStrIndex = 0; //每次开始截取的字符串的索引
+ var han = 0;
+ for (let i = 0; i < str.length; i++) {
+ if (han == 2) return;
+ //lineWidth += ctx.measureText(str[i]).width;
+ lineWidth += ut.measureText(str[i], 21.3 * unit);
+ if (lineWidth > canvasWidth) {
+ han++;
+
+ if (han == 2) {
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
+ } else {
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
+ }
+ initHeight += 22; //22为字体的高度
+ lineWidth = 0;
+ lastSubStrIndex = i;
+ titleHeight += 20;
+ }
+ if (i == str.length - 1) { //绘制剩余部分
+ ctx.textAlign = 'justify';
+ ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
+ }
+ }
+ },
+
+ // 生成海报
+ drawPlaybill: function () {
+ var that = this
+ // 适配屏get幕
+ let scale = this.data.windowWidth / 375.0
+
+ this.setData({ totalHeight: 667*scale})
+ // 获取Canvas
+ let ctx = wx.createCanvasContext('myCanvas')
+
+ // 放大 因为不放大的话,生成的分享图会模糊。暂时先注释
+ ctx.scale(this.data.canvasScale, this.data.canvasScale)
+
+ // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ // os.stoid;
+
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ + "?sceneValue=1012" + "&pageValue=packageA/pages/liveStreamDetails/liveStreamDetails"
+ // console.log('path3---->', path3);
+
+
+ // 绘制主背景白色
+ ctx.setFillStyle('#ffffff')
+ ctx.fillRect(0, 0, this.data.windowWidth, this.data.totalHeight)
+ ctx.draw(true);
+
+
+ const coverImag = this.data.details['cover_img'];
+ const title = this.data.details.name;
+ console.log('detail--->', this.data.details);
+
+
+ //绘制头像
+ wx.getImageInfo({
+ src: that.data.avatarUrl,
+ success: function(res) {
+ ctx.save();
+ ctx.beginPath();
+ ctx.arc(29*scale, 27*scale, 14*scale, 0, 2*Math.PI);
+ ctx.clip();
+ ctx.drawImage(res.path, 15*scale, 13*scale, 28*scale, 28*scale);
+ ctx.restore()
+ ctx.draw(true);
+ }
+ })
+
+ // 绘制昵称
+ ctx.setFontSize(12*scale);
+ ctx.setFillStyle('#ADADAD');
+ ctx.fillText(this.data.nickName, 54*scale, 32*scale);
+
+ //绘制主图
+ wx.getImageInfo({
+ src: coverImag,
+ success: function(res) {
+ ctx.drawImage(res.path, 0, 52*scale, 240*scale, 191*scale);
+ ctx.draw(true);
+ }
+ })
+
+ //绘制文字
+ ctx.setFontSize(14*scale);
+ ctx.setFillStyle('#1E1E1E');
+ // ctx.fillText(title, 10*scale, 281*scale, 97*scale);
+ this.drawText(ctx, title, 10*scale, 281*scale, 130*scale, 130*scale, scale);
+ // ctx.draw(true);
+
+ //绘制小程序码
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale);
+ ctx.draw(true);
+ }
+ })
+
+ //绘制文字:常按识别
+ ctx.setFontSize(14*scale);
+ ctx.setFillStyle('#1E1E1E');
+ ctx.fillText('长按识别小程序', 135*scale, 350*scale);
+
+
+ //把画板内容绘制成图片,并回调 画板图片路径
+ ctx.draw(true, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ destWidth: that.data.windowWidth*2,
+ destHeight: that.data.windowHeight*2,
+ fileType: 'jpg',
+ quality: 1,
+ canvasId: 'myCanvas',
+ success: function(res) {
+ wx.hideLoading();
+ that.setData({
+ canvasToImgPath: res.tempFilePath,
+ });
+ console.log(res.tempFilePath);
+ }
+ })
+ }, 3000)
+ });
+ },
+
+
+
+ //点击观看直播
+ clickBtn: function () {
+ let roomId = this.data.details.roomid;
+ // let customPearams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 }));
+ wx.navigateTo({
+ url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}`
+ })
+ },
+
+ // 保存图片到手机
+ onSaveToPhone() {
+ // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
+ this.getSetting().then((res) => {
+ // 判断用户是否授权了保存到相册的权限,如果没有发起授权
+ if (!res.authSetting['scope.writePhotosAlbum']) {
+ this.authorize().then(() => {
+ // 同意授权后保存下载文件
+ this.savedownloadFile(this.data.canvasToImgPath)
+ })
+ } else {
+ // 如果已经授权,保存下载文件
+ this.savedownloadFile(this.data.canvasToImgPath)
+ }
+ })
+ },
+
+ //打开设置,引导用户授权
+ onOpenSetting() {
+ wx.openSetting({
+ success:(res) => {
+ console.log(res.authSetting)
+ }
+ })
+ },
+
+ // 获取用户已经授予了哪些权限
+ getSetting() {
+ return new Promise((resolve, reject) => {
+ wx.getSetting({
+ success: res => {
+ console.log('getting---->', res);
+ resolve(res)
+ }
+ })
+ })
+ },
+
+ // 发起首次授权请求
+ authorize() {
+ // isFirst 用来记录是否为首次发起授权,
+ // 如果首次授权拒绝后,isFirst赋值为1
+ let isFirst = wx.getStorageSync('isFirst') || 0;
+ return new Promise((resolve, reject) => {
+ wx.authorize({
+ scope: 'scope.writePhotosAlbum',
+ // 同意授权
+ success: () => {
+ resolve()
+ },
+ // 拒绝授权,这里是用户拒绝授权后的回调
+ fail: res => {
+ if(isFirst === 0) {
+ wx.setStorageSync('isFirst', 1);
+ wx.showToast({
+ title: '保存失败',
+ icon: 'none',
+ duration: 1000
+ })
+ } else {
+ this.showModal()
+ }
+ console.log('拒绝授权');
+ reject()
+ }
+ })
+ })
+ },
+
+ //保存下载文件
+ savedownloadFile(img) {
+ this.downLoadFile(img).then((res) => {
+ return this.saveImageToPhotosAlbum(res.tempFilePath)
+ }).then(() => {
+ })
+ },
+
+ //单文件下载(下载文件资源到本地),客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径。
+ downLoadFile(img) {
+ return new Promise((resolve, reject) => {
+ wx.showLoading({
+ title: '保存中...',
+ mask: true,
+ });
+ wx.downloadFile({
+ url: img,
+ success: (res) => {
+ console.log('downloadfile', res)
+ resolve(res)
+ }
+ })
+ })
+ },
+
+ // 保存图片到系统相册
+ saveImageToPhotosAlbum(saveUrl) {
+ var self = this;
+ return new Promise((resolve, reject) => {
+ wx.saveImageToPhotosAlbum({
+ filePath: saveUrl,
+ success: (res) => {
+ wx.showToast({
+ title: '保存成功',
+ duration: 1000,
+ });
+ self.setData({
+ showPlaybill: 'true'
+ });
+ resolve()
+ }
+ })
+ })
+ },
+
+
+ // 弹出模态框提示用户是否要去设置页授权
+ showModal() {
+ wx.showModal({
+ title: '检测到您没有打开保存到相册的权限,是否前往设置打开?',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('用户点击确定')
+ this.onOpenSetting() // 打开设置页面
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ var that = this;
+ this.getSystemInfo();
+
+ getApp().request.promiseGet("/api/weshop/wx/livelist/get",{
+ data:{ id: options.id }
+ }).then(res=>{
+ if(res.data.code==0){
+ var obj = res.data.data;
+ var goods = JSON.parse(obj.goods);
+ obj.goods = goods;
+ that.setData({
+ details: obj
+ })
+ }
+ })
+
+ switch(options.live) {
+ case 'toBegin': {
+ this.setData({
+ btnText: '订阅'
+ })
+ break;
+ }
+ case 'ing': {
+ this.setData({
+ btnText: '进入直播间'
+ })
+ break;
+ }
+ default: {
+ this.setData({
+ btnText: '回放直播'
+ })
+ break;
+ }
+ }
+
+ this.setData({
+ nickName: app.globalData.userInfo.nickname,
+ avatarUrl: app.globalData.userInfo.head_pic
+ })
+
+ var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ os.stoid + "?sceneValue=1012" + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ wx.getImageInfo({
+ src: path3,
+ success: function(res) {
+ // ctx.drawImage(res.path, 152*scale, 262*scale, 66*scale, 66*scale);
+ // ctx.draw(true);
+ that.setData({
+ ewm: res.path
+ })
+ }
+ })
+ },
+
+ // 获取图片信息
+ getImageInfo(src) {
+ return new Promise((resolve, reject) => {
+ wx.getImageInfo({
+ src: src,
+ success: (res) => {
+ resolve(res);
+ }
+ })
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+ this.setData({
+ showActionSheet: 'false'
+ })
+ var self = this;
+ return {
+ title: this.data.details.name,
+ success: function(res) {
+ console.log('res---->', res);
+ },
+ complete: function(res) {
+ console.log('comple', res)
+ }
+ }
+ }
+})
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.json b/packageA/pages/liveStreamDetails/liveStreamDetails.json
new file mode 100644
index 0000000..6fc87c7
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.json
@@ -0,0 +1,6 @@
+{
+ "usingComponents": {
+ "subscribe": "plugin-private://wx2b03c6e691cd7370/components/subscribe/subscribe"
+ },
+ "navigationBarTitleText": "直播详情"
+}
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml
new file mode 100644
index 0000000..71c485e
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxml
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss
new file mode 100644
index 0000000..2b915c5
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.skeleton.wxss
@@ -0,0 +1,17 @@
+/*
+此文件为开发者工具生成,生成时间: 2020/7/4 下午3:58:01
+使用方法:参考 "packageA\pages\liveStreamDetails\liveStreamDetails.skeleton.wxml"
+*/
+.sk-transparent {
+ color: transparent !important;
+ }
+.sk-container {
+ position: absolute;
+ overflow: hidden;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ z-index: 1000000;
+ background-color: transparent;
+ }
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.wxml b/packageA/pages/liveStreamDetails/liveStreamDetails.wxml
new file mode 100644
index 0000000..59a390f
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.wxml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{details.name}}
+ {{myUtils.liveStatus(details.live_status)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+ {{item.price}}
+
+
+
+
+
+
+
+
+
+ {{btnText}}
+
+
+
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+ 生成分享海报
+
+
+ 取消
+
+
+
+
+
+
+
+ 保存至相册
+
+
+
+
+
+
+
+
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.wxss b/packageA/pages/liveStreamDetails/liveStreamDetails.wxss
new file mode 100644
index 0000000..55f26ca
--- /dev/null
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.wxss
@@ -0,0 +1,249 @@
+/* pages/liveStreamDetails/liveStreamDetails.wxss */
+.active {
+ background-color: #ddd;
+}
+
+.content {
+ background-color: white;
+ padding-bottom: 168rpx;
+}
+.cover-container {
+ height: 646rpx;
+ position: relative;
+}
+.cover-img {
+ width: 100%;
+ height: 100%;
+ background-color: #eee;
+}
+.cover-desc {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ text-align: center;
+ padding-top: 64rpx;
+ padding-bottom: 64rpx;
+ color: #fff;
+
+ background: -moz-linear-gradient(bottom,#7A7171, transparent);/*Mozilla*/
+ background: -webkit-gradient(bottom,0 50%,100% 50%,from(#7A7171),to(transparent));/*Old gradient for webkit*/
+ background: -webkit-linear-gradient(bottom,rgba(0,0,0,.8),transparent);/*new gradient for Webkit*/
+ background: -o-linear-gradient(bottom,#7A7171,transparent); /*Opera11*/
+}
+.cover-desc view:first-child {
+ font-size: 50rpx;
+}
+.cover-desc view:last-child {
+ font-size: 42rpx;
+}
+
+.desc-container {
+ padding: 56rpx 46rpx 41rpx;
+ color: #3E3E3E;
+}
+.desc-title {
+ font-size: 42rpx;
+ font-weight: bold;
+}
+.desc-status {
+ display: inline-block;
+ color: #5B5B5B;
+ font-size: 28rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+ padding: 0 30rpx;
+ background-color: #eee;
+ margin-top: 22rpx;
+ margin-bottom: 44rpx;
+}
+.desc-content {
+ font-size: 29rpx;
+}
+.list {
+ padding: 0 36rpx;
+}
+.list-item {
+ display: flex;
+ padding-bottom: 34rpx;
+}
+.list-item:not(:first-child) {
+ padding-top: 34rpx;
+}
+.list-item:not(:last-child) {
+ border-bottom: 2rpx solid #B5B5B5;
+}
+.item-pic {
+ width: 224rpx;
+ height: 224rpx;
+ border: 2rpx solid #E1E1E1;
+}
+.item-desc-container {
+ padding-left: 46rpx;
+ font-size: 26rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+.item-desc view:first-child {
+ padding-top: 10rpx;
+ padding-bottom: 38rpx;
+}
+.item-price:before {
+ content: '¥';
+}
+
+.share-container {
+ /* width: 86rpx; */
+ position: fixed;
+ padding: 0 8rpx;
+ box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.1);
+ right: 28rpx;
+ top: 50%;
+ background-color: #fff;
+}
+.share-container image {
+ display: block;
+ width: 60rpx;
+ height: 60rpx;
+ padding-top: 14rpx;
+ padding-bottom: 11rpx;
+}
+.share-container image:first-child {
+ border-bottom: 2rpx solid #E7E7E7;
+}
+
+
+.btn-container {
+ background-color: #fff;
+ box-sizing: border-box;
+ padding: 24rpx 128rpx;
+ position: fixed;
+ bottom: 0;
+ width: 100%;
+ box-shadow: 0px -1px 4px 1px rgba(0,0,0,0.1);
+}
+.btn {
+ color: #fff;
+ background-color: #f23030;
+ font-size: 36rpx;
+ line-height: 92rpx;
+ text-align: center;
+ /* width: 618rpx;
+ height: 92rpx; */
+}
+.subscribe--live-player-notSubscribe {
+ position: relative;
+}
+.subscribe--live-player-notSubscribe::before {
+ content: '订阅';
+ position: absolute;
+ left: 0;
+ width: 100%;
+ height: auto;
+ background-color: #f23030;
+ color: #fff;
+}
+.subscribe--live-player-subscribe__btn {
+ width: 100% !important;
+ height: auto !important;
+ font-size: 36rpx !important;
+ /* line-height: 120rpx !important; */
+ border-radius: 0 !important;
+ background-color: #f23030 !important;
+}
+.subscribe--live-player-hasSubscribe {
+ background-color: #666 !important;
+}
+
+.share-actionSheet {
+ background-color: white;
+ padding-top: 45rpx;
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ z-index: 2;
+}
+.share-actionSheet-title {
+ font-size: 38rpx;
+
+}
+.share-actionSheet-list {
+ display: flex;
+ justify-content: space-around;
+ padding-bottom: 30rpx;
+}
+.share-actionSheet-item {
+ text-align: center;
+ padding: 20rpx;
+}
+.share-actionSheet-pic {
+ display: block;
+ width: 118rpx;
+ height: 118rpx;
+ border-radius: 50%;
+ margin: 0 auto;
+}
+.share-actionSheet-desc {
+ font-size: 28rpx;
+}
+
+.share-actionSheet-title,
+.share-actionSheet-cancle {
+ text-align: center;
+}
+
+.share-actionSheet-cancle {
+ padding: 30rpx 0;
+ border-top: 2rpx solid #CBCBCB;
+}
+
+.mask {
+ display: none;
+ background-color: rgba(0,0,0,.7);
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
+.playbill {
+ position: fixed;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ z-index: 9999;
+ background: none;
+}
+.share-actionSheet.active ~ .mask,
+.playbill.active ~ .mask {
+ display: block;
+}
+.playbill-pic {
+ display: block;
+ width: 478rpx;
+ height: 737rpx;
+ border-width: 31rpx 20rpx 51rpx;
+ border-color: #f23030;
+ border-style: solid;
+ margin: 0 auto 26rpx;
+}
+
+.playbill-save {
+ width: 560rpx;
+ height: 100rpx;
+ line-height: 100rpx;
+ background-color: #f23030;
+ color: #fff;
+ font-size: 36rpx;
+ text-align: center;
+ margin: 0 auto;
+}
+.playbill-save image {
+ width: 44rpx;
+ height: 36rpx;
+ margin-right: 23rpx;
+}
+
+button::after {
+ border: none;
+}
\ No newline at end of file
diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js
index 450ce8e..5fef675 100644
--- a/packageA/pages/prom_list/prom_list.js
+++ b/packageA/pages/prom_list/prom_list.js
@@ -12,6 +12,7 @@ var utils = require('../../../utils/util.js'),ut=utils;
var regeneratorRuntime = require('../../../utils/runtime.js');
+
Page({
data: {
gid: "",
@@ -1568,6 +1569,12 @@ Page({
price=price.toFixed(2);
cut_pirce=cut_pirce.toFixed(2);
this.setData({dp_price: this.data.dp_price,cut_price:this.data.cut_price});
+ },
+
+ go_goods:function (e) {
+ var gid=e.currentTarget.dataset.gid;
+ var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gid;
+ getApp().goto(url);
}
diff --git a/packageA/pages/prom_list/prom_list.wxml b/packageA/pages/prom_list/prom_list.wxml
index 9a4e7cc..3ae62ef 100644
--- a/packageA/pages/prom_list/prom_list.wxml
+++ b/packageA/pages/prom_list/prom_list.wxml
@@ -6,7 +6,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
diff --git a/pages/cart/cart/cart.wxss b/pages/cart/cart/cart.wxss
index 2f4dac1..9817577 100644
--- a/pages/cart/cart/cart.wxss
+++ b/pages/cart/cart/cart.wxss
@@ -346,3 +346,8 @@ radio {
.title .english .esh {
margin: 0rpx 15rpx;
}
+
+page {
+ overflow-x: hidden;
+ padding-bottom: 100rpx;
+}
diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js
index e037e4b..beeae0f 100644
--- a/pages/cart/cart2/cart2.js
+++ b/pages/cart/cart2/cart2.js
@@ -1381,6 +1381,13 @@ Page({
//是不是重新提交
if(th.data.is_continue==1) item.is_continue=1;
+ //获取立即购买的商品的信息
+ var gg = to.get_b_now();
+ //--商品的房间号--
+ if(gg.room_id && gg.room_id>0){
+ item.room_ids=gg.room_id;
+ }
+
var order_prom_list={};
//--判断有没有优惠活动--
if(th.data.order_prom[item.pickup_id]){
@@ -1418,7 +1425,7 @@ Page({
item.coupon_no=th.data.using_quan[th.data.bn_pick].coupon_no;
item.coupon_price=0;
}
- var gg = to.get_b_now();
+
var goods={
'goods_id': gg.goods_id,
'goods_name': gg.goods_name,
@@ -1445,6 +1452,11 @@ Page({
})
}
+ //--商品的房间号--
+ if(gg.room_id && gg.room_id>0){
+ goods.room_id=gg.room_id;
+ }
+
//如果不立即购买或者秒杀,如果是线下库存购买的时候
if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){
var isok=1;
@@ -1495,8 +1507,7 @@ Page({
var addr = th.data.user_addr;
if (th.data.is_all_zt == 1) addr = null;
var val_arr= t.detail.value;
- console.log('购物车结算');
- console.log(val_arr);
+
if(th.data.is_all_zt !=1)
if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){
@@ -1505,6 +1516,7 @@ Page({
}
var order_prom_list_cart=th.data.order_prom_list_cart;
+
//--组装推送数据--
for (var i = 0; i < order_prom_list_cart.length;i++){
var t_item = order_prom_list_cart[i];
@@ -1569,8 +1581,11 @@ Page({
}
if(Object.keys(order_prom_list).length>0)
item.order_prom_list=order_prom_list;
- //-------------让商品添加到商品列表--------------------
- for (var k = 0; k < t_item.goods.length;k++){
+
+ //房间号的ids
+ var room_ids="";
+ //-------------让商品添加到商品列表--------------------
+ for (var k = 0; k < t_item.goods.length;k++){
var g_item = t_item.goods[k];
var goods = {
'goods_id': g_item.goods_id,
@@ -1644,12 +1659,20 @@ Page({
}
})
}
-
+ //如果房间号不为空的时候
+ if(g_item.room_id){
+ goods.room_id=g_item.room_id;
+ room_ids+=g_item.room_id+",";
+ }
item.order_goods.push(goods);
}
+
+ //如果房间号不为空的时候
+ if(room_ids!="") item.room_ids= ut.sub_last(room_ids);
pdata.push(item);
}
- console.log(pdata);
+
+
}
if (pdata.length==0) return;
diff --git a/pages/cart/cart2_pt/cart2_pt.js b/pages/cart/cart2_pt/cart2_pt.js
index d5a4918..c1dd1d7 100644
--- a/pages/cart/cart2_pt/cart2_pt.js
+++ b/pages/cart/cart2_pt/cart2_pt.js
@@ -449,7 +449,13 @@ Page({
})
}
- item.order_goods.push(goods);
+ //--商品的房间号--
+ if(gg.room_id && gg.room_id>0){
+ item.room_ids=gg.room_id;
+ goods.room_id=gg.room_id;
+ }
+
+ item.order_goods.push(goods);
pdata.push(item);
if (pdata.length==0) return;
diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js
index 1eb560b..1e0becd 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.js
+++ b/pages/giftpack/giftpacklist/giftpacklist.js
@@ -28,6 +28,7 @@ Page({
code: "", //核销码
c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
is_lb: 0, //是否有礼包
+ default_color:null,
},
onLoad: function(options) {
@@ -60,6 +61,13 @@ Page({
var that = this.data;
var th = this;
// var id = e.currentTarget.dataset.id;//活动id
+ //如果还没有开始的话
+ if(th.data.isStart!=1){
+ getApp().my_warnning("活动还没有开始", 0, th);
+ return false;
+ }
+
+
var money = e.currentTarget.dataset.money;
var my_confirm = th.selectComponent("#my_confirm"); //组件的id
my_confirm.open(
@@ -100,7 +108,7 @@ Page({
getApp().goto(url);
},
fail: function(n) {
- getApp().my_confirm("取消支付", 0, th);
+ getApp().my_warnning("取消支付", 0, th);
}
});
} else {
@@ -124,6 +132,12 @@ Page({
GetBuyIntegral: function(e) {
var that = this.data;
var th = this;
+
+ //如果还没有开始的话
+ if(th.data.isStart!=1){
+ getApp().my_warnning("活动还没有开始", 0, th);
+ return false;
+ }
// var id = e.currentTarget.dataset.id;//活动id
var my_confirm = th.selectComponent("#my_confirm"); //组件的id
my_confirm.open(
@@ -177,7 +191,8 @@ Page({
if (res.data.code == 0) {
th.setData({
giftImage: th.data.iurl + res.data.data.lbUrl,
- giftTitle: res.data.data.giftTitle
+ giftTitle: res.data.data.giftTitle,
+ default_color:res.data.data.bgcolor
})
if (res.data.data.giftRemark == '') {
th.setData({
@@ -224,7 +239,7 @@ Page({
}
}
} else {
- getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
+ getApp().my_warnning(res.data.msg, 0, th);
return false;
}
}
@@ -245,7 +260,8 @@ Page({
if (res.data.code == 0) {
_this2.setData({
giftImage: th.iurl + res.data.data.lbUrl,
- giftTitle: res.data.data.giftTitle
+ giftTitle: res.data.data.giftTitle,
+ default_color:res.data.data.bgcolor
})
if (res.data.data.giftRemark == '') {
_this2.setData({
@@ -257,18 +273,28 @@ Page({
})
}
+ var isStart=0;
+ var now=ut.gettimestamp();
+
+ var str = res.data.data.starTime.replace(/-/g,'/');
+ var start = Date.parse(new Date(str));
+ start = start / 1000;
+ if(start
+
-
+
{{giftTitle}}
- {{"兑换截至时间:"+giftDate}}
+
+
+ {{"活动开始时间:"+giftStart}}
+
+
+
+ {{"兑换结束时间:"+giftDate}}
+
+ {{"活动结束时间:"+giftDate}}
+
+
+
@@ -99,29 +110,39 @@
-
-
+
+
+
+
+
+
+
+
-
+
- {{bconfig.service_bz}}
+ {{bconfig.service_bz}}
diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss
index 6448c7d..a2a6bd2 100644
--- a/pages/goods/goodsInfo/goodsInfo.wxss
+++ b/pages/goods/goodsInfo/goodsInfo.wxss
@@ -947,9 +947,10 @@ left:31rpx;}
text-overflow: ellipsis;}
.item_right text{ margin-left: 66rpx;}
-.bzfu_img{ width: 164rpx; height:34rpx; position: relative; top: 34rpx; margin-right: 18rpx; margin-left: 12rpx }
+.bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx }
.bz_view{ height:100rpx; padding: 0 13rpx; color: #333; font-size: 28rpx;
- border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; line-height: 100rpx }
+ border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; }
+ .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;}
.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333;
font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx }
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index faf1e5c..89efc1a 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -76,7 +76,7 @@ Page({
},
- onLoad: function() {
+ onLoad: async function() {
var th = this;
//看一下商家是否开通了权益
//--初始化是否有打勾--
@@ -92,26 +92,11 @@ Page({
});
}
})
-
-
- },
- //关闭新用户领取广告
- close_disgraceful: function() {
- var th = this;
- th.setData({
- is_disgraceful: 0
- })
- },
- async onShow() {
-
- var th = this
-
//调用底部导航
getApp().globalData.url=th.data.url
t.editTabBar(th,o.stoid,th.data.url);
-
await this.init_load();
//显示的时候要开启计时器
this.data.is_timer = 1;
@@ -119,16 +104,16 @@ Page({
if (this.data.isTemplate) {
//---先获取会员---
t.getUserFir(function() {
- th.is_festival();
- var new_nav = th.data.new_nav;
- if (new_nav == "") {
- th.is_new();
- }
- setTimeout(function () {
- if (getApp().globalData.user_id) getApp().requestCardNum(th);
- },500)
-
- });
+ th.is_festival();
+ var new_nav = th.data.new_nav;
+ if (new_nav == "") {
+ th.is_new();
+ }
+ setTimeout(function () {
+ if (getApp().globalData.user_id) getApp().requestCardNum(th);
+ },500)
+
+ });
} else {
await this.init_fir();
wx.setNavigationBarColor({
@@ -168,12 +153,25 @@ Page({
}).then(res => {
if (res.data.data) {
var gd_category = res.data.data.pageData;
-
th.setData({
gd_category: gd_category
});
}
})
+
+
+
+ },
+ //关闭新用户领取广告
+ close_disgraceful: function() {
+ var th = this;
+ th.setData({
+ is_disgraceful: 0
+ })
+ },
+
+ async onShow() {
+ var th = this
},
//当隐藏的时候就关闭计时器
onHide: function() {
@@ -185,6 +183,7 @@ Page({
clearInterval(i);
}
+
},
//同步初始加载
@@ -469,13 +468,12 @@ Page({
this.data.timer && (clearInterval(this.data.timer), this.data.timer = null);
},
onPageScroll: function(e) {
- this.setData({
- scrollTop: e.scrollTop
- });
+ this.data.scrollTop=e.scrollTop;
+
+
var t = getCurrentPages();
"pages/index/index/index" == t[t.length - 1].route;
- /*--
- && (e.scrollTop > 10 ? wx.setNavigationBarColor({
+ /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({
frontColor: "#ffffff",
backgroundColor: "#f95959"
}) : wx.setNavigationBarColor({
@@ -829,5 +827,4 @@ Page({
})
}
-
});
\ No newline at end of file
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index 73cd56c..0d6c695 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -249,7 +249,7 @@
-
+
diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss
index 8c7514a..e3f1467 100644
--- a/pages/index/index/index.wxss
+++ b/pages/index/index/index.wxss
@@ -9,6 +9,7 @@
width: 100%;
height: 88rpx;
z-index: 10;
+ background-color: #ff7295;
}
.classify-img {
@@ -908,4 +909,9 @@
.swiper{
height: 250rpx;
padding-bottom:30rpx;
+}
+
+page {
+ overflow-x: hidden;
+ padding-bottom: 120rpx;
}
\ No newline at end of file
diff --git a/pages/justTest/justTest.js b/pages/justTest/justTest.js
new file mode 100644
index 0000000..c36aff5
--- /dev/null
+++ b/pages/justTest/justTest.js
@@ -0,0 +1,177 @@
+// pages/justTest/justTest.js
+// let livePlayer = requirePlugin('live-player-plugin');
+
+
+var t = require("../../utils/util.js"),
+ ut = t,
+ e = require("../../utils/common.js"),
+ a = require("../../utils/wxParse/wxParse.js"),
+ s = getApp(),
+ i = s.request,
+ rq = i,
+ oo = s.globalData,
+ o = s.globalData.setting,
+ os = o;
+var utils = require('../../utils/util.js'),ut=utils;
+var regeneratorRuntime = require('../../utils/runtime.js');
+
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ gid: "",
+ stoid: o.stoid,
+ url: o.url,
+ resourceUrl: o.resourceUrl,
+ iurl: o.imghost,
+ defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
+ data: null,
+ openSpecModal: !1,
+ openPromModal: !1,
+ supportPageScroll: !1,
+
+ //联系电话
+ mobile: '',
+ bconfig:null,
+ sales_rules:1,
+
+ t_time:null,
+ card_field:"",
+ dp_price:0,
+ cut_price:0,
+ open_ind_store:1,
+ goodsInputNum:1,
+ g_buy_num: null,
+ sele_collocation:null,
+
+
+
+ photoUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1003256280,1176261798&fm=26&gp=0.jpg",
+ //(用来控制显示哪个按钮) false表示还没首次进行弹框授权,或者已经授权了;true表示在首次授权弹框时拒绝授权,或者在设置页面还是拒绝了授权
+ isAuthSavePhoto: false
+ },
+
+
+
+
+
+ sendRequest: function () {
+
+
+
+ //调用接口判断是不是会员
+ getApp().request.promiseGet("/api/weshop/wx/livelist/page",{
+ data:{store_id: 1}
+ }).then(res=>{
+ console.log(res);
+ // if(res.data.code==0){
+ // getApp().globalData.guide_id=res.data.data.id;
+ // }
+ })
+
+ },
+ // nav: function () {
+ // wx.redirectTo({
+ // url: '/packageA/pages/liveStream/liveStream'
+ // })
+ // },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+
+
+
+ saveImage() {
+ wx.showLoading({
+ title: '保存中...',
+ mask: true,
+ });
+ wx.downloadFile({
+ url:
+ 'http://upload.jianshu.io/admin_banners/web_images/4435/c1d3ca63353c8bd527f0d781605516cb5b266d02.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/1250/h/540',
+ success: function(res) {
+ if (res.statusCode === 200) {
+ let img = res.tempFilePath;
+ wx.saveImageToPhotosAlbum({
+ filePath: img,
+ success(res) {
+ wx.showToast({
+ title: '保存成功',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ fail(res) {
+ wx.showToast({
+ title: '保存失败',
+ icon: 'success',
+ duration: 2000
+ });
+ }
+ });
+ }
+ }
+ });
+ },
+
+
+
+ live() {}
+
+
+})
\ No newline at end of file
diff --git a/pages/justTest/justTest.json b/pages/justTest/justTest.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/justTest/justTest.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/justTest/justTest.wxml b/pages/justTest/justTest.wxml
new file mode 100644
index 0000000..92569ea
--- /dev/null
+++ b/pages/justTest/justTest.wxml
@@ -0,0 +1,46 @@
+
+pages/justTest/justTest.wxml
+进入直播
+进入直播详情页
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/justTest/justTest.wxss b/pages/justTest/justTest.wxss
new file mode 100644
index 0000000..3c29dd4
--- /dev/null
+++ b/pages/justTest/justTest.wxss
@@ -0,0 +1,29 @@
+/* pages/justTest/justTest.wxss */
+page {
+ background: #fff;
+ text-align: center;
+}
+
+.box {
+ padding: 30rpx 80rpx;
+}
+
+.img {
+ width: 430rpx;
+ height: 430rpx;
+ margin: 20rpx 0;
+}
+button {
+ width: 100%;
+ background: #ffffff;
+ border: none;
+ border-radius: 0rpx;
+ padding: 0;
+ margin: 0;
+}
+
+.btn {
+ background: green;
+ color: #ffffff;
+ border-radius: 0;
+}
\ No newline at end of file
diff --git a/pages/store/index.js b/pages/store/index.js
index 3dbea01..8601e17 100644
--- a/pages/store/index.js
+++ b/pages/store/index.js
@@ -12,6 +12,7 @@ Page({
is_no_more:0,
key_word:'', //关键字搜索
cat_id:0, //分类ID
+ islading:0,
},
onShow:function(){
@@ -65,6 +66,8 @@ Page({
get_list:function(){
if(this.data.is_no_more==1) return false;
+ if(this.data.islading==1) return false;
+ this.data.islading=1;
var th=this,req = getApp().request;
var dd = {
store_id: o.stoid,
@@ -84,6 +87,7 @@ Page({
req.promiseGet("/api/weshop/pickup/list", {
data: dd,
}).then(res => {
+ this.data.islading=0;
wx.hideLoading();
if(res.data.code==0){
if(res.data.data.pageData.length<=0){
@@ -132,6 +136,7 @@ Page({
cid: item['cat_id']
})
this.data.page=1;
+ this.data.is_no_more=0;
this.setData({ pick_list:null})
this.get_list();
@@ -139,7 +144,8 @@ Page({
//搜索关键字
sear:function(){
- this.data.page=1;
+ this.data.page=1;
+ this.data.is_no_more=0;
this.setData({ pick_list:null})
this.get_list();
},
diff --git a/pages/store/index.wxml b/pages/store/index.wxml
index e780603..2a5c362 100644
--- a/pages/store/index.wxml
+++ b/pages/store/index.wxml
@@ -1,8 +1,8 @@
-
+
-
+
diff --git a/pages/store/index.wxss b/pages/store/index.wxss
index 23dab93..3906111 100644
--- a/pages/store/index.wxss
+++ b/pages/store/index.wxss
@@ -42,7 +42,7 @@ position: relative;
.bcolor{background-color: #f5f5f5; height: 126rpx;}
.sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;}
-.sear_inp input{ position: relative; top:10rpx;width: 400rpx; display: inline-block;}
+.sear_inp input{width: 400rpx;}
.select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center }
-.sear_btn{ width: 50rpx; height: 100%; display: inline-block;}
+.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;}
diff --git a/pages/template/index.js b/pages/template/index.js
index 28870d2..bfbc70d 100644
--- a/pages/template/index.js
+++ b/pages/template/index.js
@@ -45,6 +45,11 @@ Page({
var data = res.data.data;
if (data) {
var temp_data = data;
+
+ wx.setNavigationBarTitle({
+ title: temp_data.page_title,
+ });
+
var t_arr = JSON.parse(temp_data.json_str);
th.setData({
template_arr: t_arr,
@@ -63,9 +68,7 @@ Page({
}
})
- wx.setNavigationBarTitle({
- title: '模板预览',
- });
+
},
diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js
index a85edeb..ac4c0f7 100644
--- a/pages/user/assistance/friend_assistance.js
+++ b/pages/user/assistance/friend_assistance.js
@@ -126,7 +126,8 @@ Page({
id: this.data.tasking,
storeId: os.stoid,
userId: this.data.userId,
- zlUserId: t_user_id
+ zlUserId: t_user_id,
+ isWeappUser:1, //是不是小程序的入口,不需要判断
};
console.log(data);
getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert",
diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml
index 3d6fa58..3cad626 100644
--- a/pages/user/index/index.wxml
+++ b/pages/user/index/index.wxml
@@ -92,12 +92,33 @@
+
+
+
+
+
+ 我的订单
+
+
+
+ 更多
+
+
+
+
待付款
{{toji.wait_pay}}
+
+
+
+ 待发货
+ {{toji.wait_send}}
+
+
待收货
@@ -115,15 +136,8 @@
-
-
-
-
- 我的订单
-
-
-
+
@@ -133,9 +147,7 @@
-
- 我的权益
-
+ 我的权益
@@ -143,6 +155,7 @@
+
@@ -178,14 +191,14 @@
-
+
工具与服务
-
+
我的拼单
diff --git a/pages/user/index/index.wxss b/pages/user/index/index.wxss
index d367144..2f178e1 100644
--- a/pages/user/index/index.wxss
+++ b/pages/user/index/index.wxss
@@ -202,13 +202,14 @@
.xc-after-sale {
width: 100%;
- height: 160rpx;
border-bottom: 10px solid #f2f2f2;
}
.xc-after-sale-left {
- width: 90%;
+ width: 96%;
height: 100%;
+ margin-top: 40rpx;
+ margin-bottom: 25rpx;
}
.xc-no-money {
@@ -300,6 +301,11 @@
height: 50rpx;
}
+.xc-send{
+ width: 50rpx;
+ height: 50rpx;
+}
+
.xc-more-click {
width: 15rpx;
height: 15rpx;
diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js
index 3be9c02..f6b0e5a 100644
--- a/pages/user/userinfo/userinfo.js
+++ b/pages/user/userinfo/userinfo.js
@@ -639,6 +639,11 @@ Page({
a.reg_time = time;
a.birthday = birthday
+
+ if(a.address=='null' || !a.address){
+ a.address="";
+ }
+
e.setData({
phone: a.mobile,
user: a,
diff --git a/utils/auth.js b/utils/auth.js
index ca87f8b..ba086b7 100644
--- a/utils/auth.js
+++ b/utils/auth.js
@@ -51,6 +51,7 @@ module.exports = {
data: {
js_code: e,
store_id: a.globalData.setting.stoid,
+ nickname:a.globalData.getu.nickName,
},
success: function (e) {
console.log("openidandkey");
@@ -90,6 +91,7 @@ module.exports = {
data: {
js_code: e,
store_id: a.globalData.setting.stoid,
+ nickname:a.globalData.getu.nickName,
},
success: function (e) {
console.log("openidandkey");
diff --git a/utils/myUtils.wxs b/utils/myUtils.wxs
new file mode 100644
index 0000000..bf9f277
--- /dev/null
+++ b/utils/myUtils.wxs
@@ -0,0 +1,42 @@
+var myUtils = {
+ // 判断直播状态
+ liveStatus: function (statusCode) {
+ var statusText;
+ switch(statusCode) {
+ case '101': {
+ statusText = '直播中';
+ break;
+ }
+ case '102': {
+ statusText = '未开始';
+ break;
+ }
+ case '103': {
+ statusText = '已结束';
+ break;
+ }
+ case '104': {
+ statusText = '禁播';
+ break;
+ }
+ case '105': {
+ statusText = '暂停中';
+ break;
+ }
+ case '106': {
+ statusText = '异常';
+ break;
+ }
+ case '107': {
+ statusText = '已过期';
+ break;
+ }
+ default: break;
+ }
+ return statusText;
+ }
+};
+
+module.exports = {
+ liveStatus: myUtils.liveStatus
+}
\ No newline at end of file