diff --git a/app.js b/app.js
index 70b7256..ceec2d2 100644
--- a/app.js
+++ b/app.js
@@ -327,12 +327,35 @@ App({
}
//---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
if(pick_id==0) return func(null);
- //获取用户注册时候的门店
+ //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭
th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{
data:{},
success:function (res) {
- th.globalData.pk_store=res.data.data;
- func(th.globalData.pk_store);
+ th.globalData.pk_store=null;
+ if(res.data.code==0 && res.data.data && res.data.data.isstop==0){
+ if(res.data.data.category_id){
+ th.request.get( "/api/weshop/storagecategory/get/"+os.stoid+"/"+res.data.data.category_id, {
+ data: {},
+ success: function (ee) {
+ if(ee.data.code==0 && ee.data.data ){
+ if(ee.data.data.is_show==1){
+ th.globalData.pk_store = res.data.data;
+ func(th.globalData.pk_store);
+ }else{
+ func(null);
+ }
+ }else{
+ func(null);
+ }
+ }
+ })
+ }else{
+ th.globalData.pk_store = res.data.data;
+ func(th.globalData.pk_store);
+ }
+ }else{
+ func(null);
+ }
}
})
}else{
@@ -340,7 +363,6 @@ App({
}
})
-
},
//-------获取购物车数量----------
diff --git a/app.json b/app.json
index 2b76d1a..73cb4fb 100644
--- a/app.json
+++ b/app.json
@@ -1,6 +1,6 @@
{
- "pages": [
- "pages/index/index/index",
+ "pages": [
+ "pages/index/index/index",
"pages/goods/categoryList/categoryList",
"pages/cart/cart/cart",
"pages/cart/cart2/cart2",
@@ -17,7 +17,6 @@
"pages/user/address_list/address_list",
"pages/user/userinfo/userinfo",
"pages/user/account/account",
- "pages/user/comment/comment",
"pages/user/return_goods_list/return_goods_list",
"pages/user/userinfo_edit/userinfo_edit",
"pages/user/collect_list/collect_list",
@@ -77,8 +76,22 @@
"pages/user/my_service/tment_eval",
"pages/user/my_service/tment_order_list",
"pages/user/my_service/beauty_deta",
+ "pages/user/labels/labels",
+
+ "pages/user/view_comment/view_comment",
+ "pages/giftpack/birthdaygift/birthdaygift",
+ "pages/user/comment/comment",
+ "pages/giftpack/evaluategift/evaluategift",
+ "pages/giftpack/newvipgift/newvipgift",
+ "pages/giftpack/payment/payment",
+ "pages/giftpack/buygiftpack/giftpackbuy",
+ "pages/giftpack/giftpacklist/giftpacklist",
+ "pages/giftpack/mygiftpack/mygiftpack",
+
+ "pages/user/assistance/giftpacklist",
+ "pages/user/assistance/task_assistance"
+
- "pages/user/labels/labels"
],
"permission": {
"scope.userLocation": {
diff --git a/components/nav_b/nav_b.js b/components/nav_b/nav_b.js
index f6c5c8d..b394f8d 100644
--- a/components/nav_b/nav_b.js
+++ b/components/nav_b/nav_b.js
@@ -1,31 +1,41 @@
-var t = getApp(), os = t.globalData.setting;
+var t = getApp(),
+ os = t.globalData.setting;
Component({
- properties: {
- },
+ properties: {},
data: {
isopen: 0,
iurl: os.imghost,
- nav_left:"首页",//导航左边
- nav_center:"预约",//导航中间
- nav_right: "我的",//导航右边
- nav_left_url: "/pages/index/index/index",//导航左边地址
- nav_center_url:"/pages/user/my_service/tment_order_list",//导航中间地址
- nav_right_url:"/pages/user/index/index",//导航右边地址
+ nav_left: "首页", //导航左边
+ nav_center: "预约", //导航中间
+ nav_right: "我的", //导航右边
+ nav_left_url: "/pages/index/index/index", //导航左边地址
+ nav_center_url: "/pages/user/my_service/tment_order_list", //导航中间地址
+ nav_right_url: "/pages/user/index/index", //导航右边地址
},
- ready: function () {
- },
+ ready: function() {},
methods: {
//--点击打开事件--
- open_box: function () {
- this.setData({ isopen: 1 });
+ open_box: function() {
+ this.setData({
+ isopen: 1
+ });
+ },
+ set_name: function(name,url) {
+ var th = this;
+ th.setData({
+ nav_center:name,
+ nav_center_url:url
+ })
},
//--关闭事件--
- close_box: function () {
- this.setData({ isopen: 0 });
+ close_box: function() {
+ this.setData({
+ isopen: 0
+ });
},
//--跳转--
- goto: function (e) {
+ goto: function(e) {
var url = e.currentTarget.dataset.url;
getApp().goto(url);
this.close_box();
diff --git a/pages/giftpack/birthdaygift/birthdaygift.js b/pages/giftpack/birthdaygift/birthdaygift.js
new file mode 100644
index 0000000..c789f95
--- /dev/null
+++ b/pages/giftpack/birthdaygift/birthdaygift.js
@@ -0,0 +1,191 @@
+var i = require("../../../utils/util.js")
+var e = getApp(),
+ a = e.globalData.setting,
+ os = a,
+ t = e.request,
+ d = e.globalData;
+Page({
+ data: {
+ url: a.url, //接口网址
+ iurl: a.imghost, //图片前缀网址
+ itemShow: false, //项目栏目是否显示
+ cardShow: false, //代金券栏目是否显示
+ packShow: false, //福利栏目是否显示
+ textShow: false, //规则是否显示
+ integralShow: true, //积分领取是否显示
+ growUpShow: true, //成长值领取是否显示
+ itemButton: '',
+ cardButton: '',
+ getActId: '',
+ getActType: '',
+ giftID: '',
+ receiveState: '一键全部领取',
+ textTitle: '',
+ getUrl: '',
+ noShow: false,
+ cards: [], //礼包内容--礼券
+ itemWare: [], //礼包内容--服务项目
+ integralTitle: "",
+ growUpTitle: "",
+ is_sub: 0, //是否重复领取
+ },
+ GetList: function () {
+ var th = this;
+ var url = "/api/weshop/marketing/giftbag/bound/get";
+ wx.showLoading({
+ title: '加载中',
+ })
+ getApp().request.promiseGet(url, {
+ data: {
+ "actId": th.data.getActId, //活动id
+ "actType": 4, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
+ "giftBagId": th.data.giftID, //礼包ID
+ "storeId": a.stoid, //商家ID
+ "userId": d.user_id //用户ID
+ }
+ }).then(res => {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
+ //礼包内容--礼券
+ th.setData({
+ cardShow: true,
+ cards: res.data.data.lbCoupons
+ })
+ }
+ if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != nll) {
+ //礼包内容--服务项目
+ th.setData({
+ itemShow: true,
+ itemWare: res.data.data.lbSM
+ })
+ }
+ //礼包积分
+ if (res.data.data.lbIntegral <= 0) {
+ if (res.data.data.lbGrowthValue <= 0) {
+ th.setData({
+ packShow: false
+ })
+ } else {
+ th.setData({
+ packShow: false,
+ integralShow: false,
+ growUpShow: true
+ })
+ }
+
+ } else {
+ if (res.data.data.lbGrowthValue > 0) {
+ th.setData({
+ packShow: true
+ })
+ } else {
+ th.setData({
+ packShow: true,
+ integralShow: true,
+ growUpShow: false
+ })
+ }
+ }
+ th.setData({
+ integralTitle: '价值' + res.data.data.lbIntegral + '积分',
+ growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值'
+ })
+ if (res.data.data.receiveState == 0) {
+ th.setData({
+ receiveState: '一键全部领取'
+ })
+ } else {
+ th.setData({
+ receiveState: '已领取'
+ })
+ }
+
+ if (res.data.data.actIntro != '') {
+ th.setData({
+ textShow: true,
+ textTitle: res.data.data.actIntro.replace(/\
/g, '\div>')
+ })
+ }
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ return false;
+ }
+ })
+ },
+
+ onLoad: function onLoad(options) {
+ var th = this;
+ th.setData({
+ getActId: options.actId,
+ giftID: options.giftBagId
+ })
+ th.GetList();
+ },
+ onShow: function onShow() {
+
+ },
+ GetReceive: function () {
+ var th = this;
+ if (th.data.receiveState == '已领取') {
+ return false;
+ }
+ var is_sub = th.data.is_sub; //判断是否重复提交
+ if (is_sub == 0) {
+ th.setData({
+ is_sub: 1
+ })
+ wx.showLoading({
+ title: '加载中',
+ })
+ var json = {
+ "actId": th.data.getActId, //活动Id
+ "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
+ "giftBagId": th.data.giftID, //礼包Id
+ "storeId": a.stoid, //商家Id
+ "userId": d.user_id //用户ID
+ };
+ var data = JSON.stringify(json);
+ var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
+ wx.request({
+ url: url,
+ data: data,
+ method: 'post',
+ header: {
+ 'content-type': 'application/json'
+ }, // 设置请求的 header
+ success: function (res) {
+ wx.hideLoading();
+ th.setData({
+ is_sub: 0
+ })
+ if (res.data.code == 0) {
+ th.setData({
+ receiveState: '已领取'
+ })
+ getApp().my_warnning("领取成功", 1, th);
+ } else {
+ getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
+ }
+ }
+ })
+ }
+ },
+ //界面跳转
+ goto: function (e) {
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
+ },
+ //图片失败,默认图片
+ bind_bnerr1: function (e) {
+ var th = this;
+ var _errImg = e.target.dataset.errorimg;
+ var _Img = e.target.dataset.img;
+ if (_Img != undefined) {
+ var _errObj = {};
+ _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png";
+ th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ }
+ },
+});
\ No newline at end of file
diff --git a/pages/giftpack/birthdaygift/birthdaygift.json b/pages/giftpack/birthdaygift/birthdaygift.json
new file mode 100644
index 0000000..ebd948e
--- /dev/null
+++ b/pages/giftpack/birthdaygift/birthdaygift.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "生日礼包",
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm"
+ }
+}
\ No newline at end of file
diff --git a/pages/giftpack/birthdaygift/birthdaygift.wxml b/pages/giftpack/birthdaygift/birthdaygift.wxml
new file mode 100644
index 0000000..d7a564b
--- /dev/null
+++ b/pages/giftpack/birthdaygift/birthdaygift.wxml
@@ -0,0 +1,176 @@
+
+
+
+
+
+
+
+
+ ______
+
+
+ 新人专享\n你的美丽我来缔造
+
+
+ ______
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 免费领取
+
+
+ {{item.fromName}}
+
+
+
+
+ {{item.fromName}}
+
+
+ {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}
+
+
+ 数量:
+ {{item.num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享优惠券
+
+
+ ———
+
+
+
+
+
+
+
+
+ 全场通用
+
+
+ 品牌限定
+
+
+ 品类限定
+
+
+ 用途限定
+
+
+ 分类限定
+
+
+
+ 包邮券
+
+
+ {{item.sum+"元券"}}
+ {{"满"+item.buySum+"元可以用"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享福利
+
+
+ ———
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 本活动最终解释权归公司所有,如果有问题请联系客服
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/giftpack/birthdaygift/birthdaygift.wxss b/pages/giftpack/birthdaygift/birthdaygift.wxss
new file mode 100644
index 0000000..33e96fa
--- /dev/null
+++ b/pages/giftpack/birthdaygift/birthdaygift.wxss
@@ -0,0 +1,339 @@
+@charset "UTF-8";
+/* Author XGQ
+ * 2019-10-27
+ */
+.image_box {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+.image_box image {
+ width: 100%;
+ height: 690rpx;
+}
+.top {
+ margin: -20rpx 28rpx 45rpx 28rpx;
+ padding: 10rpx 10rpx 70rpx 10rpx;
+ background-color: #FFFFFF;
+ border-radius: 0rpx 0rpx 15rpx 15rpx;
+}
+.top_box {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+.top_box_text {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ margin: 50rpx 15rpx 20rpx 15rpx;
+}
+.top_box_text text {
+ color: #FB6451;
+ font-size: 40rpx;
+}
+.top_item {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ width: 100%;
+ margin: 60rpx 0 0 0;
+}
+.top_item_img {
+ float: left;
+ width: 28%;
+ margin: 0rpx 10rpx 0rpx 20rpx;
+}
+.top_item_img image {
+ width: 150rpx;
+ height: 150rpx;
+ border-radius: 50%;
+ border: #F96865 solid 3rpx;
+}
+.top_item_center {
+ float: left;
+ width: 50%;
+}
+.top_item_center_title {
+ font-size: 35rpx;
+ color: #FB6451;
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ padding: 0 10rpx 15rpx 0rpx;
+ word-break: break-all;
+ /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical;
+ /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp: 2;
+ /** 显示的行数 **/
+ overflow: hidden;
+ /** 隐藏超出的内容 **/
+}
+.top_item_center_ramke {
+ font-size: 25rpx;
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ line-height: 35rpx;
+ letter-spacing: 0.5rpx;
+ word-break: break-all;
+ /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical;
+ /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp: 2;
+ /** 显示的行数 **/
+ overflow: hidden;
+ /** 隐藏超出的内容 **/
+}
+.top_item_button {
+ float: right;
+ width: 22%;
+ padding: 65rpx 20rpx 0 1rpx;
+}
+.top_item_button button {
+ font-size: 25rpx;
+ background: #fd6969;
+ color: #FFFFFF;
+ border-radius: 50rpx;
+ height: 45rpx;
+ line-height: 45rpx;
+}
+.top_card {
+ width: calc(50% - 30rpx);
+ display: inline-block;
+ margin: 15rpx;
+}
+.top_card_box {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ border-radius: 20rpx;
+ height: 250rpx;
+ margin: 5rpx;
+}
+.img1 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png);
+}
+.img2 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png);
+}
+.img3 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png);
+}
+.top_card_tite_box {
+ width: 100%;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+.top_card_tite_a {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #FFFFFF;
+ background: #ffa7c0;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+.top_card_tite_b {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #FFFFFF;
+ background: #50dfdb;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+.top_card_tite_c {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #FFFFFF;
+ background: #92cbff;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+.top_card_tite_d {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #FFFFFF;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+.top_card_counte {
+ padding: 40rpx 20rpx 0 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ color: #FFFFFF;
+ font-size: 40rpx;
+}
+.top_card_remak {
+ padding: 20rpx 0 40rpx 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ font-size: 20rpx;
+ color: #FFFFFF;
+}
+.top_card_button_a button {
+ margin: 0 85rpx;
+ background: #ffa6bc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+.top_card_button_b button {
+ margin: 0 85rpx;
+ background: #50dfdb;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+.top_card_button_c button {
+ margin: 0 85rpx;
+ background: #75bcfc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+.top_card_button_d button {
+ margin: 0 85rpx;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+.top_box_image {
+ padding: 20rpx 20rpx 20rpx 20rpx;
+}
+.top_box_image image {
+ height: 216rpx;
+ width: 100%;
+}
+.top_box_image button {
+ margin: 15rpx 95rpx 0rpx 95rpx;
+ background: #fe6a6a;
+ border-radius: 50rpx;
+ line-height: 60rpx;
+ height: 60rpx;
+ color: white;
+ font-size: 30rpx;
+}
+.foot_box {
+ margin: 0 30rpx 40rpx 30rpx;
+ background: #FFFFFF;
+ border-radius: 20rpx;
+}
+.foot_box_title {
+ font-size: 43rpx;
+ color: #000000;
+ padding: 20rpx 30rpx 20rpx 30rpx;
+}
+.foot_box_text {
+ font-size: 30rpx;
+ color: #000000;
+ line-height: 48rpx;
+ padding: 20rpx 35rpx 50rpx 30rpx;
+}
+.button_box {
+ margin: 50rpx 50rpx 50rpx 50rpx;
+ text-align: center;
+}
+.button {
+ margin: 0 30rpx;
+ background: #61d3dd;
+ border-radius: 50rpx;
+ line-height: 80rpx;
+ height: 80rpx;
+ color: white;
+ font-size: 35rpx;
+}
+.button_text {
+ padding-top: 20rpx;
+ font-size: 20rpx;
+ color: white;
+ height: 100rpx;
+}
+.foot_empty {
+ height: 90rpx;
+}
+.foot_button {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 20rpx 0rpx 0rpx 0rpx;
+ padding: 25rpx 0rpx;
+ background: #FFFFFF;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+}
+.foot_button_buy {
+ background: #e4010c;
+ color: #FFFFFF;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+.foot_button_notbuy{
+ background: #999999;
+ color: #FFFFFF;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 30rpx 30rpx 30rpx 30rpx;
+}
+page {
+ background-color: #9be0e5;
+}
+button::after {
+ border: none;
+}
+.foot_box_text ._img {
+ width: 100%;
+}
+.foot_box_text .img {
+ line-height: 0;
+}
+
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js
index 5bd9134..ed1aa98 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.js
+++ b/pages/giftpack/buygiftpack/giftpackbuy.js
@@ -11,8 +11,8 @@ Page({
getStorageID: '',
getUserID: '',
wareCard: [],
- page: 0,
- pageSize: 10,
+ // page: 0,
+ // pageSize: 10,
isEmpty: false,
loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore
contentText: {
@@ -23,7 +23,7 @@ Page({
ismore: 0, //数据是否全部加载完成
is_read: 0, //是否查询过我的礼包接口
curpage: 1, //当前分页数
- pageSize: 3, //页大小
+ pageSize: 10, //页大小
total: 0, //总数量
},
onLoad: function(options) {
@@ -37,13 +37,7 @@ Page({
th.getList();
},
onShow: function() {
- // var th = this;
- // th.setData({
- // pages: 1,
- // pageSize: 10,
- // loadingType: 0
- // })
- // th.getList();
+
},
GetBuyPrice: function(e) {
@@ -51,6 +45,9 @@ Page({
var th = this;
var id = e.currentTarget.dataset.id; //活动id
var my_confirm = th.selectComponent("#my_confirm"); //组件的id
+ var order_sn = e.currentTarget.dataset.order_sn; //订单号
+ var money = e.currentTarget.dataset.money; //支付金额
+
my_confirm.open(
"是否确定购买该礼包",
"取消",
@@ -60,17 +57,48 @@ Page({
},
function() {
my_confirm.open_cancel(0);
+ wx.showLoading({
+ title: '加载中',
+ })
var json = {
"actId": '', //活动Id
"actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
"buyType": '2', //1=积分兑换 2=余额购买
- "lbId": id, //礼包Id
+ "giftBagId": id, //礼包Id
"storeId": that.getStorageID, //商家Id
"userId": that.getUserID, //用户ID
"buyFrom": 2
};
var data = JSON.stringify(json);
var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
+ getApp().request.json_post(url, json,
+ function(res) {
+ if (res.data.code == 0) {
+ var order_sn = res.data.data.orderSn;
+ res = res.data.data.result;
+ var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
+ wx.requestPayment({
+ timeStamp: String(res.timeStamp),
+ nonceStr: res.nonceStr,
+ package: res.packageValue,
+ signType: res.signType,
+ paySign: res.paySign,
+ success: function(res) {
+ getApp().goto(url);
+ },
+ fail: function(res) {
+ getApp().my_confirm("取消支付", 0, th);
+ }
+ });
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ },
+ function(res) {
+
+ }
+
+ )
wx.request({
url: url,
data: data,
@@ -79,19 +107,22 @@ Page({
'content-type': 'application/json'
}, // 设置请求的 header
success: function(res) {
+ wx.hideLoading();
if (res.data.code == 0) {
- res = res.data.data;
+ var order_sn = res.data.data.orderSn;
+ res = res.data.data.result;
+ var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
wx.requestPayment({
timeStamp: String(res.timeStamp),
nonceStr: res.nonceStr,
package: res.packageValue,
signType: res.signType,
paySign: res.paySign,
- success: function(n) {
-
+ success: function(res) {
+ getApp().goto(url);
},
- fail: function(n) {
-
+ fail: function(res) {
+ getApp().my_confirm("取消支付", 0, th);
}
});
} else {
@@ -102,7 +133,6 @@ Page({
}
-
)
@@ -121,31 +151,32 @@ Page({
},
function() {
my_confirm.open_cancel(0);
+ wx.showLoading({
+ title: '加载中',
+ })
var json = {
"actId": '', //活动Id
"actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
"buyType": '1', //1=积分兑换 2=余额购买
- "lbId": id, //礼包Id
+ "giftBagId": id, //礼包Id
"storeId": that.getStorageID, //商家Id
"userId": that.getUserID //用户ID
};
var data = JSON.stringify(json);
var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
- wx.request({
- url: url,
- data: data,
- method: 'post',
- header: {
- 'content-type': 'application/json'
- }, // 设置请求的 header
- success: function(res) {
+ getApp().request.json_post(url, json,
+ function(res) {
if (res.data.code == 0) {
getApp().my_warnning("兑换成功!", 1, th);
} else {
getApp().my_warnning(res.data.msg, 0, th);
}
+ },
+ function(res) {
+
}
- })
+
+ )
})
@@ -153,6 +184,7 @@ Page({
getList: function(e) {
var th = this;
getApp().request.get('/api/weshop/marketing/giftbag/page', {
+ isShowLoading: true,
data: {
storeId: th.data.getStorageID, //商家ID
userId: th.data.getUserID, //用户ID
@@ -196,9 +228,8 @@ Page({
navigateTo: function(e) {
var th = this;
var url = e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url,
- })
+ getApp().goto(url);
+
},
//下拉事件
onReachBottom: function() {
@@ -210,5 +241,16 @@ Page({
})
th.getList();
},
-
+ //图片失败,默认图片
+ bind_bnerr2: function(e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] = "/public/images/empty.jpg";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ },
+ goto: function(e) {
+ var th = this;
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
+ }
})
\ No newline at end of file
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.json b/pages/giftpack/buygiftpack/giftpackbuy.json
index f5d4df2..6acc1c4 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.json
+++ b/pages/giftpack/buygiftpack/giftpackbuy.json
@@ -1,7 +1,5 @@
{
"navigationBarTitleText": "礼包列表",
- "navigationStyle": "custom",
- "enablePullDownRefresh": false,
"usingComponents": {
"warn": "/components/long_warn/long_warn",
"my_confirm": "/components/my_confirm/my_confirm"
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxml b/pages/giftpack/buygiftpack/giftpackbuy.wxml
index 53c9c16..b99e9d7 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.wxml
+++ b/pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -1,6 +1,6 @@
-
+
@@ -13,13 +13,13 @@
-
+
-
+
- {{items.giftTitle}}
+ {{items.giftTitle}}
@@ -39,7 +39,7 @@
{{"原价:¥"+items.giftPosPrice}}
- {{"活动时间:"+items.endTime}}
+ {{"活动结束时间:"+items.endTime}}
@@ -48,15 +48,29 @@
{{"已售:"+items.giftQty+"件"}}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -71,7 +85,7 @@
当前暂无礼包
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.wxss b/pages/giftpack/buygiftpack/giftpackbuy.wxss
index a43b773..45f3688 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.wxss
+++ b/pages/giftpack/buygiftpack/giftpackbuy.wxss
@@ -16,7 +16,7 @@ page {
.top_img image {
width: 100%;
- height: 660rpx;
+
}
.top_title {
@@ -150,16 +150,12 @@ page {
line-height: 110rpx;
}
-.box_button_remark {
-
-}
-
.box_button_remark text {
font-size: 28rpx;
color: #b9b5b5;
}
-.box_button_buy button {
+.box_button_dui {
display: inline-block;
width: 160rpx;
height: 50rpx;
@@ -167,17 +163,14 @@ page {
background: #fff;
color: #000;
line-height: 50rpx;
+ margin-left: 20rpx;
+ border-radius: 10rpx;
}
-.box_button_dui button {
- display: inline-block;
- width: 160rpx;
- height: 50rpx;
- font-size: 20rpx;
+.box_button_buy {
background: #d41c34;
color: #fff;
- line-height: 50rpx;
- margin-left: 20rpx;
+ border-radius: 10rpx;
}
.foot_box {
diff --git a/pages/giftpack/evaluategift/evaluategift.js b/pages/giftpack/evaluategift/evaluategift.js
new file mode 100644
index 0000000..b41121c
--- /dev/null
+++ b/pages/giftpack/evaluategift/evaluategift.js
@@ -0,0 +1,208 @@
+var i = require("../../../utils/util.js")
+var e = getApp(),
+ a = e.globalData.setting,
+ os = a,
+ t = e.request,
+ d = e.globalData;
+Page({
+ data: {
+ url: a.url, //接口网址
+ iurl: a.imghost, //图片前缀网址
+ itemShow: false, //项目栏目是否显示
+ cardShow: false, //代金券栏目是否显示
+ packShow: false, //福利栏目是否显示
+ textShow: false, //规则是否显示
+ integralShow: true, //积分领取是否显示
+ growUpShow: true, //成长值领取是否显示
+ itemButton: '',
+ cardButton: '',
+ getActId: '',
+ getActType: '',
+ giftBagId: '',
+ receiveState: '一键全部领取',
+ textTitle: '',
+ getUrl: '',
+ noShow: false,
+ cards: [], //礼包内容--礼券
+ itemWare: [], //礼包内容--服务项目
+ integralTitle: "",
+ growUpTitle: "",
+ is_sub: 0, //是否重复领取
+ orderNumber: "", //订单号
+ orderGoodsId: "", //商品id
+ orderType:1,
+ },
+ GetList: function() {
+ var th = this;
+ wx.showLoading({
+ title: '加载中',
+ })
+ var url = "/api/weshop/marketing/giftbag/bound/get";
+ getApp().request.promiseGet(url, {
+ data: {
+ "actId": th.data.getActId, //活动Id
+ "actType": 2, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
+ "storeId": a.stoid, //商家Id
+ "userId": d.user_id, //用户ID
+ "orderNumber": th.data.orderNumber,
+ "orderType": th.data.orderType,
+ "orderGoodsId": th.data.orderGoodsId,
+ "gifbagid": th.data.giftBagId
+ }
+ }).then(res => {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ if (res.data.data.lbCoupons.length > 0 && res.data.data.lbCoupons != null) {
+ //礼包内容--礼券
+ th.setData({
+ cardShow: true,
+ cards: res.data.data.lbCoupons
+ })
+ }
+ if (res.data.data.lbSM.length > 0 && res.data.data.lbSM != null) {
+ //礼包内容--服务项目
+ th.setData({
+ itemShow: true,
+ itemWare: res.data.data.lbSM
+ })
+ }
+ //礼包积分
+ if (res.data.data.lbIntegral <= 0) {
+ if (res.data.data.lbGrowthValue <= 0) {
+ th.setData({
+ packShow: false
+ })
+ } else {
+ th.setData({
+ packShow: false,
+ integralShow: false,
+ growUpShow: true
+ })
+ }
+
+ } else {
+ if (res.data.data.lbGrowthValue > 0) {
+ th.setData({
+ packShow: true
+ })
+ } else {
+ th.setData({
+ packShow: true,
+ integralShow: true,
+ growUpShow: false
+ })
+ }
+ }
+ th.setData({
+ integralTitle: '价值' + res.data.data.lbIntegral + '积分',
+ growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值'
+ })
+ if (res.data.data.receiveState == 0) {
+ th.setData({
+ receiveState: '一键全部领取'
+ })
+ } else {
+ th.setData({
+ receiveState: '已领取'
+ })
+ }
+
+ if (res.data.data.actIntro != '') {
+ th.setData({
+ textShow: true,
+ textTitle: res.data.data.actIntro
+ })
+ }
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ return false;
+ }
+ })
+ },
+ onLoad: function(options) {
+ var th = this;
+ th.setData({
+ getActId: options.actId,
+ orderNumber: options.orderNumber,
+ orderGoodsId: options.orderGoodsId,
+ giftBagId: options.giftBagId
+ })
+
+ var orderType = options.orderType;
+ if (orderType) {
+ th.setData({ orderType: orderType})
+ }
+
+
+ th.GetList();
+ },
+ onShow: function() {
+ var th = this;
+ var textTitle = th.data.textTitle.replace(/
![]()
+
+
+
+
+
+
+
+ ______
+
+
+ 新人专享\n你的美丽我来缔造
+
+
+ ______
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 免费领取
+
+
+ {{item.fromName}}
+
+
+
+
+ {{item.fromName}}
+
+
+ {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}
+
+
+ 数量:
+ {{item.num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享优惠券
+
+
+ ———
+
+
+
+
+
+
+
+
+ 全场通用
+
+
+ 品牌限定
+
+
+ 品类限定
+
+
+ 用途限定
+
+
+ 分类限定
+
+
+ {{item.sum+"元券"}}
+ {{"满"+item.buySum+"元可以用"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享福利
+
+
+ ———
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 本活动最终解释权归公司所有,如果有问题请联系客服
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/giftpack/evaluategift/evaluategift.wxss b/pages/giftpack/evaluategift/evaluategift.wxss
new file mode 100644
index 0000000..02ad479
--- /dev/null
+++ b/pages/giftpack/evaluategift/evaluategift.wxss
@@ -0,0 +1,400 @@
+@charset "UTF-8";
+
+/* Author XGQ
+ * 2019-10-27
+ */
+
+.image_box {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.image_box image {
+ width: 100%;
+ height: 690rpx;
+}
+
+.top {
+ margin: -20rpx 28rpx 45rpx 28rpx;
+ padding: 10rpx 10rpx 70rpx 10rpx;
+ background-color: #fff;
+ border-radius: 0rpx 0rpx 15rpx 15rpx;
+}
+
+.top_box {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.top_box_text {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ margin: 50rpx 15rpx 20rpx 15rpx;
+}
+
+.top_box_text text {
+ color: rgb(71, 132, 239);
+ font-size: 40rpx;
+}
+
+.top_item {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ width: 100%;
+ margin: 60rpx 0 0 0;
+}
+
+.top_item_img {
+ float: left;
+ width: 28%;
+ margin: 0rpx 10rpx 0rpx 20rpx;
+}
+
+.top_item_img image {
+ width: 150rpx;
+ height: 150rpx;
+ border-radius: 50%;
+ border: #f96865 solid 3rpx;
+}
+
+.top_item_center {
+ float: left;
+ width: 50%;
+}
+
+.top_item_center_title {
+ font-size: 35rpx;
+ color: rgb(71, 132, 239);
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ padding: 0 10rpx 15rpx 0rpx;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.top_item_center_ramke {
+ font-size: 25rpx;
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ line-height: 35rpx;
+ letter-spacing: 0.5rpx;
+ word-break: break-all;
+ /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical;
+ /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp: 2;
+ /** 显示的行数 **/
+ overflow: hidden;
+ /** 隐藏超出的内容 **/
+}
+
+.top_item_button {
+ float: right;
+ width: 22%;
+ padding: 65rpx 20rpx 0 1rpx;
+}
+
+.top_item_button button {
+ font-size: 25rpx;
+ background: #fd6969;
+ color: #fff;
+ border-radius: 50rpx;
+ height: 45rpx;
+ line-height: 45rpx;
+}
+
+.top_card {
+ width: calc(50% - 30rpx);
+ display: inline-block;
+ margin: 15rpx;
+}
+
+.top_card_box {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ border-radius: 20rpx;
+ height: 250rpx;
+ margin: 5rpx;
+}
+
+.img1 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png);
+}
+
+.img2 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png);
+}
+
+.img3 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png);
+}
+
+.top_card_tite_box {
+ width: 100%;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+.top_card_tite_a {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #ffa7c0;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_b {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #50dfdb;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_c {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #92cbff;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_d {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_counte {
+ padding: 40rpx 20rpx 0 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ color: #fff;
+ font-size: 40rpx;
+}
+
+.top_card_remak {
+ padding: 20rpx 0 40rpx 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ font-size: 20rpx;
+ color: #fff;
+}
+
+.top_card_button_a button {
+ margin: 0 85rpx;
+ background: #ffa6bc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_b button {
+ margin: 0 85rpx;
+ background: #50dfdb;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_c button {
+ margin: 0 85rpx;
+ background: #75bcfc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_d button {
+ margin: 0 85rpx;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_box_image {
+ padding: 20rpx 20rpx 20rpx 20rpx;
+}
+
+.top_box_image image {
+ height: 216rpx;
+ width: 100%;
+}
+
+.top_box_image button {
+ margin: 15rpx 95rpx 0rpx 95rpx;
+ background: #fe6a6a;
+ border-radius: 50rpx;
+ line-height: 60rpx;
+ height: 60rpx;
+ color: white;
+ font-size: 30rpx;
+}
+
+.foot_box {
+ margin: 0 30rpx 40rpx 30rpx;
+ /* background: #FFFFFF; */
+ border-radius: 20rpx;
+ background-color: rgb(255, 255, 255);
+}
+
+.foot_box_title {
+ /* color: #000000; */
+ padding: 20rpx 30rpx 20rpx 30rpx;
+}
+
+.foot_box_text {
+ font-size: 30rpx;
+ /* color: #000000; */
+ line-height: 48rpx;
+ padding: 20rpx 35rpx 50rpx 30rpx;
+}
+
+.button_box {
+ margin: 50rpx 50rpx 50rpx 50rpx;
+ text-align: center;
+}
+
+.button {
+ margin: 0 30rpx;
+ background: rgb(93, 147, 245);
+ border-radius: 50rpx;
+ line-height: 80rpx;
+ height: 80rpx;
+ color: rgb(255, 255, 255);
+ font-size: 35rpx;
+}
+
+.button_text {
+ padding-top: 20rpx;
+ font-size: 22rpx;
+ color: white;
+ height: 100rpx;
+}
+
+.foot_empty {
+ height: 90rpx;
+}
+
+.foot_button {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 20rpx 0rpx 0rpx 0rpx;
+ padding: 25rpx 0rpx;
+ background: #fff;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+}
+
+.foot_button_buy {
+ background: rgb(71, 132, 239);
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+.foot_button_notbuy {
+ background: #999;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+page {
+ background-color: rgb(71, 132, 239);
+}
+
+button::after {
+ border: none;
+}
+
+.foot_box_text ._img {
+ width: 100%;
+}
+
+.foot_box_text .img {
+ line-height: 0;
+}
+.num {
+ color: rgb(71, 132, 239);
+}
+
+.lvip {
+ left: 30rpx;
+ bottom: -58rpx;
+ width: 20rpx;
+ height: 90rpx;
+ z-index: 5;
+}
+
+.rvip {
+ right: 30rpx;
+ bottom: -58rpx;
+ width: 20rpx;
+ height: 90rpx;
+ z-index: 5;
+}
diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js
index bfd99dd..050415b 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.js
+++ b/pages/giftpack/giftpacklist/giftpacklist.js
@@ -3,6 +3,8 @@ var e = getApp(),
os = a,
t = e.request,
d = e.globalData;
+var ut = require("../../../utils/util.js");
+
Page({
data: {
url: a.url, //接口网址
@@ -22,14 +24,15 @@ Page({
getUrl: '',
wareCard: [],
orderSn: "", //订单编号
- lbId:""
+ lbId: "",
+ code: "", //核销码
+ c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
+ is_lb: 0, //是否有礼包
},
onLoad: function(options) {
var th = this;
th.setData({
isBuy: options.isBuy,
- getStorageID: a.stoid,
- getUserID: d.user_id,
getGiftID: options.lbId,
orderSn: options.orderSn
})
@@ -38,75 +41,69 @@ Page({
} else {
th.GetBuyGiftList();
}
- th.setData({
- giftRemark: th.data.giftRemark.replace(/
![]()
![]()
![]()
-
+
@@ -40,19 +40,19 @@
-
+
-
+
-
+
-
+
-
+
@@ -66,17 +66,24 @@
{{"数量:"+item.num}}
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
- 已自动到账
+ 奖励已发放
@@ -88,42 +95,60 @@
活动说明
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/giftpack/giftpacklist/giftpacklist.wxss b/pages/giftpack/giftpacklist/giftpacklist.wxss
index 1f5ccb2..3d906ad 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.wxss
+++ b/pages/giftpack/giftpacklist/giftpacklist.wxss
@@ -1,203 +1,244 @@
-
@charset "UTF-8";
+
/* Author XGQ
* 2019-12-12
*/
+
.box.data-v-3a5b7e36 {
- -webkit-align-content: center;
- align-content: center;
+ -webkit-align-content: center;
+ align-content: center;
+ background-color: #e85f93;
}
+
.box_top.data-v-3a5b7e36 {
- width: 100%;
+ width: 100%;
}
+
.box_top image.data-v-3a5b7e36 {
- width: 100%;
- height: 540rpx;
+ width: 100%;
+ max-height: 540rpx;
}
+
.box_title.data-v-3a5b7e36 {
- margin: 10rpx 20rpx 20rpx 20rpx;
- padding: 35rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
+ margin: 10rpx 20rpx 20rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
}
+
.top_title.data-v-3a5b7e36 {
- font-size: 30rpx;
- margin-bottom: 10rpx;
+ font-size: 30rpx;
+ margin-bottom: 10rpx;
}
+
.top_time.data-v-3a5b7e36 {
- font-size: 27rpx;
- color: #B9B5B5;
+ font-size: 27rpx;
+ color: #b9b5b5;
}
+
.top_price.data-v-3a5b7e36 {
- font-size: 35rpx;
- color: #D61B30;
- margin-top: 30rpx;
- margin-bottom: 5rpx;
+ font-size: 35rpx;
+ color: #d61b30;
+ margin-top: 30rpx;
+ margin-bottom: 5rpx;
}
+
.top_foot.data-v-3a5b7e36 {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
}
+
.top_foot_price.data-v-3a5b7e36 {
- font-size: 22rpx;
- color: #B9B5B5;
- width: 50%;
- text-decoration: line-through;
+ font-size: 22rpx;
+ color: #b9b5b5;
+ width: 50%;
+ text-decoration: line-through;
}
+
.top_foot_qty.data-v-3a5b7e36 {
- font-size: 22rpx;
- color: #B9B5B5;
- width: 50%;
- -webkit-align-content: flex-end;
- align-content: flex-end;
- text-align: right;
+ font-size: 22rpx;
+ color: #b9b5b5;
+ width: 50%;
+ -webkit-align-content: flex-end;
+ align-content: flex-end;
+ text-align: right;
}
+
.box_ware.data-v-3a5b7e36 {
- margin: 10rpx 20rpx 20rpx 20rpx;
- padding: 35rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
+ margin: 10rpx 20rpx 20rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
}
+
.box_ware_title.data-v-3a5b7e36 {
- font-size: 35rpx;
- margin: 5rpx 0rpx 30rpx 0rpx;
+ font-size: 35rpx;
+ margin: 5rpx 0rpx 30rpx 0rpx;
}
+
.box_ware_box.data-v-3a5b7e36 {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- margin: 10rpx 0rpx 25rpx 0rpx;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 10rpx 0rpx 25rpx 0rpx;
}
-.box_ware_img.data-v-3a5b7e36 {
+
+/* .box_ware_img.data-v-3a5b7e36 {
width: 30%;
height: 180rpx;
border: #999999 solid 1rpx;
-}
+} */
+
.box_ware_img image.data-v-3a5b7e36 {
- width: 100%;
- height: 100%;
+ /* width: 185rpx;
+ height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
+ border: 2rpx solid #999;
+ width: 120rpx;
+ height: 120rpx;
}
+
.box_ware_item.data-v-3a5b7e36 {
- width: 70%;
- margin-left: 25rpx;
- position: relative;
+ width: 70%;
+ margin-left: 25rpx;
+ position: relative;
}
+
.box_ware_item_title.data-v-3a5b7e36 {
- font-size: 30rpx;
- word-break: break-all;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
+ font-size: 24rpx;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
}
+
.box_ware_count.data-v-3a5b7e36 {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
}
+
.box_ware_item_price.data-v-3a5b7e36 {
- font-size: 25rpx;
- color: #B9B5B5;
- position: absolute;
- bottom: 60rpx;
- left: 0;
+ font-size: 25rpx;
+ color: #b9b5b5;
+ position: absolute;
+ bottom: 60rpx;
+ left: 0;
}
+
.box_ware_item_qty.data-v-3a5b7e36 {
- font-size: 25rpx;
- position: absolute;
- bottom: 15rpx;
- left: 0;
+ font-size: 22rpx;
+ position: absolute;
+ bottom: 15rpx;
+ left: 0;
}
+
.box_ware_code.data-v-3a5b7e36 {
- position: absolute;
- bottom: 10rpx;
- right: 10rpx;
+ position: absolute;
+ right: 10rpx;
+ bottom: 10rpx;
}
+
.box_ware_code image.data-v-3a5b7e36 {
- width: 60rpx;
- height: 60rpx;
+ width: 50rpx;
+ height: 50rpx;
}
+
.box_ware_code text.data-v-3a5b7e36 {
- font-size: 20rpx;
+ font-size: 20rpx;
}
+
.foot_box.data-v-3a5b7e36 {
- margin: 10rpx 20rpx 50rpx 20rpx;
- padding: 35rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
+ margin: 10rpx 20rpx 50rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
}
+
.foot_box_title.data-v-3a5b7e36 {
- font-size: 35rpx;
- margin-bottom: 30rpx;
+ font-size: 35rpx;
+ margin-bottom: 30rpx;
}
+
.foot_box_remark.data-v-3a5b7e36 {
- font-size: 27rpx;
- line-height: 40rpx;
+ font-size: 27rpx;
+ line-height: 40rpx;
}
+
.foot_empty.data-v-3a5b7e36 {
- height: 90rpx;
+ height: 90rpx;
}
+
.foot_button.data-v-3a5b7e36 {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- margin: 20rpx 0rpx 0rpx 0rpx;
- padding: 25rpx 0rpx;
- background: #FFFFFF;
- text-align: center;
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 20rpx 0rpx 0rpx 0rpx;
+ padding: 25rpx 0rpx;
+ background: #fff;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
}
+
.foot_button_left.data-v-3a5b7e36 {
- background: #e4010c;
- color: #FFFFFF;
- width: 250rpx;
- height: 70rpx;
- font-size: 28rpx;
- line-height: 70rpx;
- border-radius: 30rpx 0rpx 0rpx 30rpx;
+ background: #e4010c;
+ color: #fff;
+ width: 250rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
}
+
.foot_button_right.data-v-3a5b7e36 {
- background: #ffbb42;
- color: #FFFFFF;
- width: 250rpx;
- height: 70rpx;
- font-size: 28rpx;
- line-height: 70rpx;
- border-radius: 0rpx 30rpx 30rpx 0rpx;
+ background: #ffbb42;
+ color: #fff;
+ width: 250rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
}
+
.foot_button_buy.data-v-3a5b7e36 {
- background: #e4010c;
- color: #FFFFFF;
- width: 400rpx;
- height: 70rpx;
- font-size: 28rpx;
- line-height: 70rpx;
- border-radius: 30rpx 30rpx 30rpx 30rpx;
+ background: #e4010c;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
}
+
.foot_button_intalge.data-v-3a5b7e36 {
- background: #ffbb42;
- color: #FFFFFF;
- width: 400rpx;
- height: 70rpx;
- font-size: 28rpx;
- line-height: 70rpx;
- border-radius: 30rpx 30rpx 30rpx 30rpx;
+ background: #ffbb42;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
}
+
page.data-v-3a5b7e36 {
background-color: #e85f93;
}
+
.foot_box_remark.data-v-3a5b7e36 ._img {
width: 100%;
}
+
.foot_box_remark.data-v-3a5b7e36 .img {
line-height: 0;
}
-
+.overdue.data-v-3a5b7e36{
+ background-color: rgb(153,153,153);
+}
\ No newline at end of file
diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js
index 35c810b..5108445 100644
--- a/pages/giftpack/mygiftpack/mygiftpack.js
+++ b/pages/giftpack/mygiftpack/mygiftpack.js
@@ -11,8 +11,8 @@ Page({
getStorageID: '',
getUserID: '',
wareCard: [],
- pages: 0,
- pageSize: 10,
+ // pages: 0,
+ // pageSize: 10,
isEmpty: false,
loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore
contentText: {
@@ -23,68 +23,29 @@ Page({
ismore:0,//数据是否全部加载完成
is_read:0,//是否查询过我的礼包接口
curpage: 1, //当前分页数
- pageSize: 3, //页大小
+ pageSize: 10, //页大小
total: 0, //总数量
},
onLoad: function(options) {
- // this.getStorageID = options.stoid;
- // this.getUserID = options.userid;
var th = this;
th.setData({
getStorageID: a.stoid,
getUserID: d.user_id,
- pages: 1,
- pageSize: 3,
loadingType: 0,
getDate: i.formatTime(new Date().getTime())
})
th.getList();
},
onShow: function() {
- // this.pages = 1;
- // this.pageSize = 10;
- // this.loadingType = 0;
- // this.getList();
- // var th = this;
- // th.setData({
- // pages: 1,
- // pageSize: 10,
- // loadingType: 0
- // })
- // th.getList();
- },
- // methods: {
- // BuyGift: function BuyGift() {
- // /*销毁跳转*/
- // uni.reLaunch({
- // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID
- // });
-
- // },
- // GetGiftPackList: function(getId, ojb) {
- // //不销毁调整
- // uni.navigateTo({
- // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' +
- // getId
- // });
- // },
+ },
getList: function() {
var th = this;
- // if (th.data.loadingType) {
- // return false;
- // }
- // // that.loadingType = 1;
- // th.setData({
- // loadingType: 1
- // })
+
getApp().request.get('/api/weshop/marketing/my/giftbag/page', {
+ isShowLoading:true,
data: {
- // "storeId": this.getStorageID, //商家ID
- // "userId": this.getUserID, //用户ID
- // "page": this.pages,
- // "pageSize": this.pageSize
storeId: th.data.getStorageID, //商家ID
userId: th.data.getUserID, //用户ID
page: th.data.curpage,
@@ -110,47 +71,7 @@ Page({
is_read: 1
})
}
- // if (res.data.code == 0) {
- // if (res.data.data.total > 0) {
- // // _this.isEmpty = false;
- // _this.setData({
- // isEmpty: false
- // })
- // } else {
- // // _this.isEmpty = true;
- // _this.setData({
- // isEmpty: true
- // })
- // }
- // if (res.data.data.pageData.length == 0) {
- // // _this.loadingType = 2;
- // _this.setData({
- // loadingType: 2
- // })
- // } else {
- // var wareCard = that.wareCard;
- // var is_resad = 0;
- // // if (_this.wareCard.length < res.data.data.pageData.length) {
- // if (wareCard.length < res.data.data.total) {
- // for (var i = 0; i < res.data.data.pageData.length; i++) {
- // wareCard.push(res.data.data.pageData[i]);
- // }
- // }else{
- // is_resad=1
- // }
- // _this.setData({
- // wareCard: wareCard,
- // is_resad: is_resad
- // })
-
- // // _this.loadingType = 0;
- // _this.setData({
- // loadingType: 0
- // })
- // }
- // } else {
-
- // }
+
}
});
@@ -169,9 +90,7 @@ Page({
navigateTo: function (e) {
var th = this;
var url = e.currentTarget.dataset.url;
- wx.navigateTo({
- url: url,
- })
+ getApp().goto(url);
},
//下拉事件
onReachBottom: function () {
@@ -183,5 +102,13 @@ Page({
})
th.getList();
},
+ //图片失败,默认图片
+ bind_bnerr2: function (e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errObj = {};
+ _errObj[_errImg] = "/public/images/empty.jpg";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+
+ },
});
\ No newline at end of file
diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxml b/pages/giftpack/mygiftpack/mygiftpack.wxml
index ecd8de2..0c215d5 100644
--- a/pages/giftpack/mygiftpack/mygiftpack.wxml
+++ b/pages/giftpack/mygiftpack/mygiftpack.wxml
@@ -1,7 +1,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
@@ -42,7 +42,7 @@
- {{item.giftTitle}}
+ {{item.giftTitle}}
@@ -94,14 +94,11 @@
当前暂无礼包
-
diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxss b/pages/giftpack/mygiftpack/mygiftpack.wxss
index f723b7b..3cd1647 100644
--- a/pages/giftpack/mygiftpack/mygiftpack.wxss
+++ b/pages/giftpack/mygiftpack/mygiftpack.wxss
@@ -12,7 +12,6 @@
.top_img image {
width: 100%;
- height: 660rpx;
}
.top_title {
@@ -236,7 +235,7 @@
}
page {
- background-color: #fb7454;
+ background-color: rgb(250, 120, 88);
}
.After_all {
height: 80rpx;
diff --git a/pages/giftpack/newvipgift/newvipgift.js b/pages/giftpack/newvipgift/newvipgift.js
new file mode 100644
index 0000000..d19ccc0
--- /dev/null
+++ b/pages/giftpack/newvipgift/newvipgift.js
@@ -0,0 +1,192 @@
+var i = require("../../../utils/util.js")
+var e = getApp(),
+ a = e.globalData.setting,
+ os = a,
+ t = e.request,
+ d = e.globalData;
+Page({
+ data: {
+ url: a.url, //接口网址
+ iurl: a.imghost, //图片前缀网址
+ itemShow: false, //项目栏目是否显示
+ cardShow: false, //代金券栏目是否显示
+ packShow: false, //福利栏目是否显示
+ textShow: false, //规则是否显示
+ integralShow: true, //积分领取是否显示
+ growUpShow: true, //成长值领取是否显示
+ itemButton: '',
+ cardButton: '',
+ getActId: '',
+ getActType: '',
+ giftID: '',
+ receiveState: '一键全部领取',
+ textTitle: '',
+ getUrl: '',
+ noShow: false,
+ cards: [], //礼包内容--礼券
+ itemWare: [], //礼包内容--服务项目
+ integralTitle: "",
+ growUpTitle: "",
+ is_sub: 0, //是否重复领取
+
+ },
+ GetList: function() {
+ var th = this;
+ var url = "/api/weshop/marketing/giftbag/bound/get";
+ wx.showLoading({
+ title: '加载中',
+ })
+ getApp().request.promiseGet(url, {
+ data: {
+ "actId": th.data.getActId, //活动id
+ "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
+ "giftBagId": th.data.giftID, //礼包ID
+ "storeId": a.stoid, //商家ID
+ "userId": d.user_id //用户ID
+ }
+ }).then(res => {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
+ //礼包内容--礼券
+ th.setData({
+ cardShow: true,
+ cards: res.data.data.lbCoupons
+ })
+ }
+ if (res.data.data.lbSM != null && res.data.data.lbSM.length > 0) {
+ //礼包内容--服务项目
+ th.setData({
+ itemShow: true,
+ itemWare: res.data.data.lbSM
+ })
+ }
+ //礼包积分
+ if (res.data.data.lbIntegral <= 0) {
+ if (res.data.data.lbGrowthValue <= 0) {
+ th.setData({
+ packShow: false
+ })
+ } else {
+ th.setData({
+ packShow: false,
+ integralShow: false,
+ growUpShow: true
+ })
+ }
+
+ } else {
+ if (res.data.data.lbGrowthValue > 0) {
+ th.setData({
+ packShow: true
+ })
+ } else {
+ th.setData({
+ packShow: true,
+ integralShow: true,
+ growUpShow: false
+ })
+ }
+ }
+ th.setData({
+ integralTitle: '价值' + res.data.data.lbIntegral + '积分',
+ growUpTitle: '价值' + res.data.data.lbGrowthValue + '成长值'
+ })
+ if (res.data.data.receiveState == 0) {
+ th.setData({
+ receiveState: '一键全部领取'
+ })
+ } else {
+ th.setData({
+ receiveState: '已领取'
+ })
+ }
+
+ if (res.data.data.actIntro != '') {
+ th.setData({
+ textShow: true,
+ textTitle: res.data.data.actIntro.replace(/\
/g, '\div>')
+ })
+ }
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ return false;
+ }
+ })
+ },
+
+ onLoad: function(options) {
+ var th = this;
+ th.setData({
+ getActId: options.actId,
+ giftID: options.giftBagId
+ })
+ th.GetList();
+ },
+ onShow: function() {
+
+ },
+ GetReceive: function() {
+ var th = this;
+ if (th.data.receiveState == '已领取') {
+ return false;
+ }
+ var is_sub = th.data.is_sub; //判断是否重复提交
+ if (is_sub == 0) {
+ th.setData({
+ is_sub: 1
+ })
+ wx.showLoading({
+ title: '加载中',
+ })
+ var json = {
+ "actId": th.data.getActId, //活动Id
+ "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
+ "giftBagId": th.data.giftID, //礼包Id
+ "storeId": a.stoid, //商家Id
+ "userId": d.user_id //用户ID
+ };
+ var data = JSON.stringify(json);
+ var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
+ wx.request({
+ url: url,
+ data: data,
+ method: 'post',
+ header: {
+ 'content-type': 'application/json'
+ }, // 设置请求的 header
+ success: function(res) {
+ wx.hideLoading();
+ th.setData({
+ is_sub: 0
+ })
+ if (res.data.code == 0) {
+ th.setData({
+ receiveState: '已领取'
+ })
+ getApp().my_warnning("领取成功", 1, th);
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ }
+ })
+ }
+ },
+ //界面跳转
+ goto: function(e) {
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
+ },
+ //图片失败,默认图片
+ bind_bnerr1: function(e) {
+ var th = this;
+ var _errImg = e.target.dataset.errorimg;
+ var _Img = e.target.dataset.img;
+ if (_Img != undefined) {
+ var _errObj = {};
+ _errObj[_errImg] = "/miniapp/images/giftbag/gift02.png";
+ th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ }
+ },
+});
\ No newline at end of file
diff --git a/pages/giftpack/newvipgift/newvipgift.json b/pages/giftpack/newvipgift/newvipgift.json
new file mode 100644
index 0000000..807b825
--- /dev/null
+++ b/pages/giftpack/newvipgift/newvipgift.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "新人礼",
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm"
+ }
+}
\ No newline at end of file
diff --git a/pages/giftpack/newvipgift/newvipgift.wxml b/pages/giftpack/newvipgift/newvipgift.wxml
new file mode 100644
index 0000000..b3852a1
--- /dev/null
+++ b/pages/giftpack/newvipgift/newvipgift.wxml
@@ -0,0 +1,176 @@
+
+
+
+
+
+
+
+
+ ______
+
+
+ 新人专享\n你的美丽我来缔造
+
+
+ ______
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 免费领取
+
+
+ {{item.fromName}}
+
+
+
+
+ {{item.fromName}}
+
+
+ {{"新人可免费享受专业"+item.fromName+",可以享受"+item.num+"次。"}}
+
+
+ 数量:
+ {{item.num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享优惠券
+
+
+ ———
+
+
+
+
+
+
+
+
+ 全场通用
+
+
+ 品牌限定
+
+
+ 品类限定
+
+
+ 用途限定
+
+
+ 分类限定
+
+
+
+ 包邮券
+
+
+ {{item.sum+"元券"}}
+
+ {{"满"+item.buySum+"元可以用"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ———
+
+
+ 新人专享福利
+
+
+ ———
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 本活动最终解释权归公司所有,如果有问题请联系客服
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/giftpack/newvipgift/newvipgift.wxss b/pages/giftpack/newvipgift/newvipgift.wxss
new file mode 100644
index 0000000..ed30127
--- /dev/null
+++ b/pages/giftpack/newvipgift/newvipgift.wxss
@@ -0,0 +1,416 @@
+@charset "UTF-8";
+
+/* Author XGQ
+ * 2019-10-27
+ */
+
+.image_box {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.image_box image {
+ width: 100%;
+ height: 690rpx;
+}
+
+.top {
+ margin: -20rpx 28rpx 45rpx 28rpx;
+ padding: 10rpx 10rpx 70rpx 10rpx;
+ background-color: #fff;
+ border-radius: 0rpx 0rpx 15rpx 15rpx;
+}
+
+.top_box {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+}
+
+.top_box_text {
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ margin: 50rpx 15rpx 20rpx 15rpx;
+}
+
+.top_box_text text {
+ color: #fb6451;
+ font-size: 40rpx;
+}
+
+.top_item {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ width: 100%;
+ margin: 60rpx 0 0 0;
+}
+
+.top_item_img {
+ float: left;
+ width: 28%;
+ margin: 0rpx 10rpx 0rpx 20rpx;
+}
+
+.top_item_img image {
+ width: 150rpx;
+ height: 150rpx;
+ border-radius: 50%;
+ border: #f96865 solid 3rpx;
+}
+
+.top_item_center {
+ float: left;
+ width: 50%;
+}
+
+.top_item_center_title {
+ font-size: 35rpx;
+ color: #fb6451;
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ padding: 0 10rpx 15rpx 0rpx;
+ word-break: break-all;
+ /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical;
+ /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp: 2;
+ /** 显示的行数 **/
+ overflow: hidden;
+ /** 隐藏超出的内容 **/
+}
+
+.top_item_center_ramke {
+ font-size: 25rpx;
+ -webkit-box-pack: start;
+ -webkit-justify-content: flex-start;
+ justify-content: flex-start;
+ line-height: 35rpx;
+ letter-spacing: 0.5rpx;
+ word-break: break-all;
+ /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical;
+ /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp: 2;
+ /** 显示的行数 **/
+ overflow: hidden;
+ /** 隐藏超出的内容 **/
+}
+
+.top_item_button {
+ float: right;
+ width: 22%;
+ padding: 65rpx 20rpx 0 1rpx;
+}
+
+.top_item_button button {
+ font-size: 25rpx;
+ background: #fd6969;
+ color: #fff;
+ border-radius: 50rpx;
+ height: 45rpx;
+ line-height: 45rpx;
+}
+
+.top_card {
+ width: calc(50% - 30rpx);
+ display: inline-block;
+ margin: 15rpx;
+}
+
+.top_card_box {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ border-radius: 20rpx;
+ height: 250rpx;
+ margin: 5rpx;
+}
+
+.img1 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip01.png);
+}
+
+.img2 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip02.png);
+}
+
+.img3 {
+ background-image: url(https://mshopimg.yolipai.net/miniapp/images/giftbag/vip03.png);
+}
+
+.top_card_tite_box {
+ width: 100%;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: end;
+ -webkit-justify-content: flex-end;
+ justify-content: flex-end;
+}
+
+.top_card_tite_a {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #ffa7c0;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_b {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #50dfdb;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_c {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ background: #92cbff;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_tite_d {
+ padding: 5rpx 25rpx 5rpx 25rpx;
+ line-height: 29rpx;
+ font-size: 25rpx;
+ color: #fff;
+ border-radius: 0rpx 20rpx 0rpx 6rpx;
+}
+
+.top_card_counte {
+ padding: 40rpx 20rpx 0 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ color: #fff;
+ font-size: 40rpx;
+}
+
+.top_card_remak {
+ padding: 20rpx 0 40rpx 0;
+ text-align: center;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ align-items: center;
+ font-size: 20rpx;
+ color: #fff;
+}
+
+.top_card_button_a button {
+ margin: 0 85rpx;
+ background: #ffa6bc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_b button {
+ margin: 0 85rpx;
+ background: #50dfdb;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_c button {
+ margin: 0 85rpx;
+ background: #75bcfc;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_card_button_d button {
+ margin: 0 85rpx;
+ border-radius: 50rpx;
+ line-height: 40rpx;
+ height: 40rpx;
+ color: white;
+ font-size: 25rpx;
+}
+
+.top_box_image {
+ padding: 20rpx 20rpx 20rpx 20rpx;
+}
+
+.top_box_image image {
+ height: 216rpx;
+ width: 100%;
+}
+
+.top_box_image button {
+ margin: 15rpx 95rpx 0rpx 95rpx;
+ background: #fe6a6a;
+ border-radius: 50rpx;
+ line-height: 60rpx;
+ height: 60rpx;
+ color: white;
+ font-size: 30rpx;
+}
+
+.foot_box {
+ margin: 0 30rpx 40rpx 30rpx;
+ background: #fff;
+ border-radius: 20rpx;
+}
+
+.foot_box_title {
+ color: #000;
+ padding: 20rpx 30rpx 20rpx 30rpx;
+}
+
+.foot_box_text {
+ font-size: 30rpx;
+ color: #000;
+ line-height: 48rpx;
+ padding: 20rpx 35rpx 50rpx 30rpx;
+}
+
+.button_box {
+ margin: 50rpx 50rpx 50rpx 50rpx;
+ text-align: center;
+}
+
+.button {
+ margin: 0 30rpx;
+ background: #ff9a8c;
+ border-radius: 50rpx;
+ line-height: 80rpx;
+ height: 80rpx;
+ color: white;
+ font-size: 35rpx;
+}
+
+.button_text {
+ padding-top: 20rpx;
+ font-size: 20rpx;
+ color: white;
+ height: 100rpx;
+}
+
+.foot_empty {
+ height: 90rpx;
+}
+
+.foot_button {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 20rpx 0rpx 0rpx 0rpx;
+ padding: 25rpx 0rpx;
+ background: #fff;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ z-index: 10;
+}
+
+.foot_button_buy {
+ background: #e4010c;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+.foot_button_notbuy {
+ background: #999;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+page {
+ background-color: #fb6451;
+}
+
+button::after {
+ border: none;
+}
+
+.foot_box_text ._img {
+ width: 100%;
+}
+.foot_box_text .p{
+ width: 100%;
+}
+
+.foot_box_text .img {
+ line-height: 0;
+}
+.image {
+ width: 400rpx;
+ height: 200rpx;
+}
+.div_class{
+ width: 600rpx;
+}
+
+.num {
+ color: #fb6451;
+}
+
+.lvip {
+ left: 30rpx;
+ bottom: -58rpx;
+ width: 20rpx;
+ height: 90rpx;
+ z-index: 5;
+}
+
+.rvip {
+ right: 30rpx;
+ bottom: -58rpx;
+ width: 20rpx;
+ height: 90rpx;
+ z-index: 5;
+}
\ No newline at end of file
diff --git a/pages/giftpack/payment/payment.js b/pages/giftpack/payment/payment.js
new file mode 100644
index 0000000..6356cee
--- /dev/null
+++ b/pages/giftpack/payment/payment.js
@@ -0,0 +1,30 @@
+var e = getApp();
+var regeneratorRuntime = require('../../../utils/runtime.js');
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url: e.globalData.setting.imghost,
+ resourceUrl: e.globalData.setting.resourceUrl,
+ iurl: e.globalData.setting.imghost,
+ allmoney: 0,
+ order_sn: "",
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ wx.setNavigationBarTitle({
+ title: '支付成功',
+ });
+ var money = parseFloat(options.money), order_sn = options.order_sn;
+ this.setData({allmoney:money,order_sn:order_sn})
+ },
+
+ goto: function () {
+ var url = '/pages/index/index/index';
+ getApp().goto(url)
+ },
+})
\ No newline at end of file
diff --git a/pages/giftpack/payment/payment.json b/pages/giftpack/payment/payment.json
new file mode 100644
index 0000000..1111654
--- /dev/null
+++ b/pages/giftpack/payment/payment.json
@@ -0,0 +1,4 @@
+{
+ "navigationBarTitleText": "支付成功",
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/giftpack/payment/payment.wxml b/pages/giftpack/payment/payment.wxml
new file mode 100644
index 0000000..8a23c10
--- /dev/null
+++ b/pages/giftpack/payment/payment.wxml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+ 订单支付成功!
+
+
+
+
+
+
+
+ 订单编号 :
+ {{order_sn}}
+
+
+
+
+ 实付金额 :
+
+ {{filters.toFix(allmoney,2)}}元
+
+
+
+
+ 支付方式 :
+ 微信支付
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 我的礼包
+
+
+
+
+ 回到首页
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/giftpack/payment/payment.wxss b/pages/giftpack/payment/payment.wxss
new file mode 100644
index 0000000..f69e931
--- /dev/null
+++ b/pages/giftpack/payment/payment.wxss
@@ -0,0 +1,84 @@
+page {
+ border-top: 2rpx solid rgb(245, 245, 245);
+}
+.line {
+ border-top: 2rpx solid rgb(245, 245, 245);
+ width: 700rpx;
+}
+
+.payradio .Success_box {
+ padding-top: 45rpx;
+ padding-bottom: 45rpx;
+}
+
+.payradio .Success_box .Success_box_title {
+ margin-top: 45rpx;
+ color: rgb(8, 8, 8);
+}
+
+.payradio image {
+ width: 140rpx;
+ height: 140rpx;
+ display: flex;
+}
+
+.payitem_max {
+ padding: 0rpx 55rpx;
+ color: rgb(104, 104, 104);
+ padding-bottom: 30rpx;
+}
+
+.payitem_max .payitem {
+ margin-top: 30rpx;
+}
+
+.payitem_max .payitem .pay_nam {
+ width: 200rpx;
+}
+
+.payitem_max .payitem view {
+ margin-right: 50rpx;
+}
+.pay_money{
+ color: rgb(219, 27, 52);
+}
+
+.pay_User {
+ padding-left: 55rpx;
+ color: rgb(104, 104, 104);
+}
+
+.pay_User .payitem {
+ margin-top: 30rpx;
+}
+
+.pay_User .payitem .pay_Receiving {
+ width: 128rpx;
+ margin-right: 50rpx;
+}
+
+.pay_User .payitem .pay_name {
+ margin-right: 38rpx;
+ max-width: 250rpx;
+}
+
+.pay_order {
+ margin-top: 115rpx;
+ color: rgb(104, 104, 104);
+ width: 560rpx;
+ height: 62rpx;
+ border-radius: 30rpx;
+ border: 3rpx solid rgb(209, 209, 209);
+}
+
+.pay_home {
+ margin-top: 35rpx;
+ color: rgb(255, 255, 255);
+ width: 566rpx;
+ height: 68rpx;
+ border-radius: 30rpx;
+ background-color: rgb(219, 27, 52);
+}
+.address{
+ width: 470rpx;
+}
\ No newline at end of file
diff --git a/pages/goods/categoryList/categoryList.wxss b/pages/goods/categoryList/categoryList.wxss
index 9d88db5..3eb60ef 100644
--- a/pages/goods/categoryList/categoryList.wxss
+++ b/pages/goods/categoryList/categoryList.wxss
@@ -81,14 +81,22 @@ swiper{
.f_item .pic_view{position: relative; height: 240rpx;}
.fl_img{width: 100%; height: 100%;}
-.fenlei_text_v{text-align: left; margin-bottom: 15rpx; margin-top: 5rpx}
+.fenlei_text_v{text-align: left; margin-bottom: 10rpx; margin-top: 15rpx}
.over_view{width: 100%; height: 100%; position: absolute;top: 0; left: 0; background-color: rgba(0,0,0,0.1);}
.f_item_over_t{margin: 0 auto; position: absolute; top:80rpx;left: 50%; color: #fff; font-weight: bold;
margin-left: -100rpx; z-index: 8; width: 200rpx; text-align: center; font-size: 50rpx }
-.f_text{width: 25%; text-align: center; display: inline-block; font-size: 30rpx; margin-bottom: 15rpx;color: #9f9f9f;
-overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
+.f_text{width: 25%;
+text-align: center;
+display: inline-block;
+font-size: 30rpx;
+color: #9f9f9f;
+overflow: hidden;
+text-overflow: ellipsis;
+white-space: nowrap;
+line-height: 50rpx;
+
}
/*--国家--*/
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index e967e1a..35b53a0 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -1335,6 +1335,12 @@ Page({
}).then(res => {
var e = res;
if (e.data.code == 0) {
+
+ //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
+ if(dd.lat && !th.data.def_pick_store){
+ th.setData({def_pick_store:e.data.data.pageData[0]});
+ }
+
//-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
if (th.data.def_pick_store) {
for (var k = 0; k < e.data.data.pageData.length; k++) {
@@ -1348,7 +1354,7 @@ Page({
//单总量超出5个的时候
if (e.data.data.total > 5) {
- i.get("/api/weshop/storagecategory/page", {
+ i.get("/api/weshop/storagecategory/page", {
data: {
store_id: o.stoid,
is_show: 1,
@@ -1356,7 +1362,7 @@ Page({
},
success: function(ee) {
if (ee.data.code == 0) {
- if (ee.data.data.pageData.length > 0) {
+ if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
var def_arr = new Array();
var ishas = 0;
//-- 开始就看5个门店 --
@@ -1443,16 +1449,25 @@ Page({
});
} else {
- th.setData({
- is_show_sto_cat: -1,
- only_pk: e.data.data.pageData
- });
+ th.setData({
+ is_show_sto_cat: -1,
+ only_pk: e.data.data.pageData
+ });
+ //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
+ if (!th.data.def_pick_store) {
+ th.setData({def_pick_store:e.data.data.pageData[0]})
+ }
}
} else {
th.setData({
is_show_sto_cat: -1,
only_pk: e.data.data.pageData
});
+ //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
+ if (!th.data.def_pick_store) {
+ th.setData({def_pick_store:e.data.data.pageData[0]})
+ }
+
}
}
});
@@ -1461,6 +1476,10 @@ Page({
is_show_sto_cat: 0,
only_pk: e.data.data.pageData
});
+ //-----如果没有默认门店,要取第一个门店作为默认店------
+ if (!th.data.def_pick_store) {
+ th.setData({def_pick_store:e.data.data.pageData[0]})
+ }
}
}
})
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index ddf3450..ec7ff68 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -1,17 +1,27 @@
-var e = function (e) {
+var e = function(e) {
return e && e.__esModule ? e : {
- default: e
+ default: e
};
- }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o,
- i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default();
+ }(require("../../../utils/LoadMore.js")),
+ t = getApp(),
+ a = t.request,
+ o = t.globalData.setting,
+ os = o,
+ i = require("../../../utils/util.js"),
+ ut = i,
+ s = require("../../../utils/common.js"),
+ n = new e.default();
var regeneratorRuntime = require('../../../utils/runtime.js');
var api = require('../../../api/api.js');
var d = getApp().globalData;
-
+
Page({
data: {
url: o.imghost,
- swiperimage: ["/miniapp/images/title.png"],//,"/miniapp/images/newpeople/newpeople.png"
+ swiperimage: [{
+ image: "/miniapp/images/title.png",
+ nav_url: 0
+ }],
resourceUrl: o.resourceUrl,
logo: o.appLogo,
homeData: null,
@@ -32,69 +42,78 @@ Page({
banner: null,
appdata: null,
- saleGoods: null,//秒杀数据
- pindGoods: null,//拼单数据
- newGoods:null,//新商品
- hotGoods:null,//hot商品
+ saleGoods: null, //秒杀数据
+ pindGoods: null, //拼单数据
+ newGoods: null, //新商品
+ hotGoods: null, //hot商品
//----控制是是否显示计时器---
- is_timer:1,
- ishow:0,
+ is_timer: 1,
+ ishow: 0,
//是不是显示自定义模板
- isTemplate:0,
- template_arr:null,
- bgcolor_t:'',
-
- banner_index:0,
- flash_index:0,
- pt_index:0,
-
- pt_timer_item:null,
- pt_timer_arr:null,
- pt_timer:null,
- pt_timer_active:0,
+ isTemplate: 0,
+ template_arr: null,
+ bgcolor_t: '',
+
+ banner_index: 0,
+ flash_index: 0,
+ pt_index: 0,
+
+ pt_timer_item: null,
+ pt_timer_arr: null,
+ pt_timer: null,
+ pt_timer_active: 0,
//看下商家是否开通会员权益
- is_boot:0,
- gd_category:null,
- is_no_more:0,
- max_sw_height:0, //banner的最大高度
- is_disgraceful:0,//是否显示新人广告
+ is_boot: 0,
+ gd_category: null,
+ is_no_more: 0,
+ max_sw_height: 0, //banner的最大高度
+ is_disgraceful: 0, //是否显示新人广告
+ new_image: "", //新人有礼弹窗图片
+ new_nav: "", //新人页面跳转地址
+
},
- onLoad: function () {
+ onLoad: function() {
var th = this;
- // n.init(th, "", "recommend");
//看一下商家是否开通了权益
//--初始化是否有打勾--
getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {
- data: { storeId: os.stoid }
+ data: {
+ storeId: os.stoid
+ }
}).then(res => {
if (res.data.data) {
var is_init = res.data.data.isBool;
- th.setData({ is_boot: is_init });
+ th.setData({
+ is_boot: is_init
+ });
}
})
- th.is_new();
+ // th.is_festival();
},
//关闭新用户领取广告
- close_disgraceful:function(){
+ close_disgraceful: function() {
var th = this;
- th.setData({
- is_disgraceful:0
- })
+ th.setData({
+ is_disgraceful: 0
+ })
},
async onShow() {
var th = this;
- if(getApp().globalData.user_id) getApp().requestCardNum();
+ var new_nav = th.data.new_nav;
+ if (new_nav == "") {
+ th.is_new();
+ }
+ if (getApp().globalData.user_id) getApp().requestCardNum();
await this.init_load();
//显示的时候要开启计时器
this.data.is_timer = 1;
//如果是自定义模板
if (this.data.isTemplate) {
//---先获取会员---
- t.getUserFir(function () {
- });
+ t.getUserFir(function() {});
} else {
await this.init_fir();
}
@@ -109,7 +128,9 @@ Page({
if (th.data.pt_timer_arr && th.data.pt_timer_arr.length > 0) {
for (var i in th.data.pt_timer_arr) {
var p_item = th.data.pt_timer_arr[i];
- await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {1: 1}).then(res => {
+ await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + p_item.user_id, {
+ 1: 1
+ }).then(res => {
th.data.pt_timer_arr[i].head_pic = res.data.data.head_pic;
th.data.pt_timer_arr[i].nickname = res.data.data.nickname;
})
@@ -119,51 +140,61 @@ Page({
//---处理正在6个分类----
await getApp().request.promiseGet("/api/weshop/goodscategory/page", {
- data: {store_id: os.stoid, pageSize: 5,is_show:1}
+ data: {
+ store_id: os.stoid,
+ pageSize: 5,
+ is_show: 1
+ }
}).then(res => {
- if(res.data.data) {
- var gd_category = res.data.data.pageData;
-
- th.setData({gd_category: gd_category});
+ if (res.data.data) {
+ var gd_category = res.data.data.pageData;
+
+ th.setData({
+ gd_category: gd_category
+ });
}
})
},
-
+
//当隐藏的时候就关闭计时器
- onHide:function(){
- this.data.is_timer=0;
+ onHide: function() {
+ this.data.is_timer = 0;
clearInterval(this.data.pt_timer)
},
//同步初始加载
- async init_load(){
- var th=this;
- await getApp().get_isbuy();
- this.setappdata(getApp().globalData.wxapp_buy_obj);
- await getApp().getConfig_ays();
-
- //因为营销版本的功能包含了自定义模板的功能,是同时的
- //读取全局是否有弄自定义模板
- await api.get_template_fir(o.stoid).then(res=>{
- var data=res.data.data;
- if(data.length>0){
- var temp_data=data[0];
- var t_arr=JSON.parse(temp_data.json_str);
- th.setData({ template_arr: t_arr, isTemplate: 1, bgcolor_t: temp_data.bkcolor});
- }
- })
-
-
- //--首页的问题--
- if(getApp().globalData.config && getApp().globalData.config.store_name!=undefined && getApp().globalData.config.store_name!=null ){
- wx.setNavigationBarTitle({
- title: getApp().globalData.config.store_name,
- });
- }else{
- wx.setNavigationBarTitle({
- title: getApp().globalData.setting.appName,
- });
+ async init_load() {
+ var th = this;
+ await getApp().get_isbuy();
+ this.setappdata(getApp().globalData.wxapp_buy_obj);
+ await getApp().getConfig_ays();
+
+ //因为营销版本的功能包含了自定义模板的功能,是同时的
+ //读取全局是否有弄自定义模板
+ await api.get_template_fir(o.stoid).then(res => {
+ var data = res.data.data;
+ if (data.length > 0) {
+ var temp_data = data[0];
+ var t_arr = JSON.parse(temp_data.json_str);
+ th.setData({
+ template_arr: t_arr,
+ isTemplate: 1,
+ bgcolor_t: temp_data.bkcolor
+ });
}
+ })
+
+
+ //--首页的问题--
+ if (getApp().globalData.config && getApp().globalData.config.store_name != undefined && getApp().globalData.config.store_name != null) {
+ wx.setNavigationBarTitle({
+ title: getApp().globalData.config.store_name,
+ });
+ } else {
+ wx.setNavigationBarTitle({
+ title: getApp().globalData.setting.appName,
+ });
+ }
},
//---读取数据内容---
@@ -172,16 +203,23 @@ Page({
//----广告----
var e = this;
await getApp().request.promiseGet("/api/weshop/ad/list?pid=2&store_id=" + o.stoid, {
- data:{enabled:1}
- }).then(res=>{
+ data: {
+ enabled: 1
+ }
+ }).then(res => {
var a = res.data.data;
var arr = new Array();
for (var i = 0; i < a.length; i++) {
- var tt = { 'ad_code': o.imghost + a[i].ad_code, 'media_link': '' };
+ var tt = {
+ 'ad_code': o.imghost + a[i].ad_code,
+ 'media_link': ''
+ };
arr.push(tt);
}
- if (arr.length>0) e.setData({ banner: arr, });
-
+ if (arr.length > 0) e.setData({
+ banner: arr,
+ });
+
wx.stopPullDownRefresh();
})
@@ -202,20 +240,20 @@ Page({
flash_data = e.data.data.pageData;
if (flash_data == null || flash_data.length <= 0) return false;
-
+
//当前时间戳
var nt = ut.gettimestamp();
- flash_data.forEach(function (val,ind) {
- if(val.start_time>nt) flash_data[ind].status=0;
- else if(val.end_time>nt) flash_data[ind].status=1;
- if(val.buy_num>=val.goods_num) flash_data[ind].status=2;
+ flash_data.forEach(function(val, ind) {
+ if (val.start_time > nt) flash_data[ind].status = 0;
+ else if (val.end_time > nt) flash_data[ind].status = 1;
+ if (val.buy_num >= val.goods_num) flash_data[ind].status = 2;
});
var arr = new Array();
//--三个三个一组---
- for(var i=0;i< flash_data.length;i+=3){
- arr.push(flash_data.slice(i,i+3));
+ for (var i = 0; i < flash_data.length; i += 3) {
+ arr.push(flash_data.slice(i, i + 3));
}
th.setData({
saleGoods: arr
@@ -236,35 +274,35 @@ Page({
var e = res;
if (e.data.code == 0) {
var pd_data = e.data.data.pageData;
-
+
if (pd_data.length == 0) return;
-
+
//获取当前
var nt = ut.gettimestamp();
- pd_data.forEach(function (val,ind) {
- if(val.start_time>nt) pd_data[ind].status=0;
- else if(val.end_time>nt) pd_data[ind].status=1;
- if(val.buy_num>=val.goods_num) pd_data[ind].status=2;
+ pd_data.forEach(function(val, ind) {
+ if (val.start_time > nt) pd_data[ind].status = 0;
+ else if (val.end_time > nt) pd_data[ind].status = 1;
+ if (val.buy_num >= val.goods_num) pd_data[ind].status = 2;
});
-
- //获取当前时间,比较拼团中还在未开始
+
+ //获取当前时间,比较拼团中还在未开始
var timestamp = new Date().getTime();
var is_team_tepy;
- for (var j = 0; j < pd_data.length;j++ ){
+ for (var j = 0; j < pd_data.length; j++) {
pd_data[j].is_team_tepy = 1;
- if (timestamp {
var e = res;
@@ -283,8 +327,8 @@ Page({
var new_data = e.data.data.pageData;
var arr = new Array();
//--三个三个一组---
- for(var i=0;i< new_data.length;i+=3){
- arr.push(new_data.slice(i,i+3));
+ for (var i = 0; i < new_data.length; i += 3) {
+ arr.push(new_data.slice(i, i + 3));
}
th.setData({
newGoods: arr,
@@ -295,7 +339,13 @@ Page({
//------热卖-------
await getApp().request.promiseGet("/api/weshop/goods/page?page=1", {
data: {
- is_mainshow: 1, isonsale: 1, is_on_sale: 1, store_id: o.stoid, pageSize: 9,is_hot:1,orderField:"sort"
+ is_mainshow: 1,
+ isonsale: 1,
+ is_on_sale: 1,
+ store_id: o.stoid,
+ pageSize: 9,
+ is_hot: 1,
+ orderField: "sort"
}
}).then(res => {
var e = res;
@@ -303,8 +353,8 @@ Page({
var new_data = e.data.data.pageData;
var arr = new Array();
//--三个三个一组---
- for(var i=0;i< new_data.length;i+=3){
- arr.push(new_data.slice(i,i+3));
+ for (var i = 0; i < new_data.length; i += 3) {
+ arr.push(new_data.slice(i, i + 3));
}
th.setData({
hotGoods: arr,
@@ -313,18 +363,22 @@ Page({
})
//---调用信息---
// this.requestRecommend();
- this.setData({ishow:1});
+ this.setData({
+ ishow: 1
+ });
//---先获取会员---
- t.getUserFir(function () {
+ t.getUserFir(function() {
});
var goods_list = this.selectComponent("#goods_list"); //组件的id
goods_list.init();
- setTimeout(function () { goods_list.get_list();},300)
+ setTimeout(function() {
+ goods_list.get_list();
+ }, 300)
},
//--判断小程序是否过期--
- setappdata: function (t) {
+ setappdata: function(t) {
if (t.isout == 1)
wx.navigateTo({
url: "/pages/error/error?msg=小程序已经过期",
@@ -335,40 +389,42 @@ Page({
});
},
//---加载更多是靠这个函数----
- onReachBottom: function () {
+ onReachBottom: function() {
var goods_list = this.selectComponent("#goods_list"); //组件的id
- if(goods_list) goods_list.get_list();
+ if (goods_list) goods_list.get_list();
},
- onPullDownRefresh: function (e) {
+ onPullDownRefresh: function(e) {
this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(),
this.requestRecommend();
},
- onUnload: function () {
+ onUnload: function() {
this.destroyActivityTimer();
},
- setCountTime: function (e) {
+ setCountTime: function(e) {
e.diffTime || (e.diffTime = new Date().getTime() - 1e3 * e.server_time), this.setData({
"sale.diffTime": e.diffTime
}), this.setData({
"sale.good": e.flash_sale_goods[0]
}), this.destroyActivityTimer(), this.createActivityTimer();
},
- createActivityTimer: function () {
- var e = this.data.sale, t = this;
- this.data.timer = setInterval(function () {
- var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime, o = i.transTime(a);
+ createActivityTimer: function() {
+ var e = this.data.sale,
+ t = this;
+ this.data.timer = setInterval(function() {
+ var a = 1e3 * e.good.end_time - new Date().getTime() + e.diffTime,
+ o = i.transTime(a);
a <= 0 ? t.requestHomePage() : t.setData({
"sale.countTime": o
});
}, 1e3);
},
- destroyActivityTimer: function () {
+ destroyActivityTimer: function() {
this.data.timer && (clearInterval(this.data.timer), this.data.timer = null);
},
- onPageScroll: function (e) {
+ onPageScroll: function(e) {
this.setData({
scrollTop: e.scrollTop
});
@@ -384,34 +440,34 @@ Page({
}));--*/
},
- jumpSearch: function () {
+ jumpSearch: function() {
wx.navigateTo({
url: "/pages/goods/search/search"
});
},
- onShareAppMessage: function (e) {
+ onShareAppMessage: function(e) {
return o.share;
},
//图片失败,默认图片
- bind_bnerr: function (e) {
+ bind_bnerr: function(e) {
var _errImg = e.target.dataset.errorimg;
var _errObj = {};
- _errObj[_errImg] = this.data.url+ "/miniapp/images/del/logo.jpg";
+ _errObj[_errImg] = this.data.url + "/miniapp/images/del/logo.jpg";
this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
},
//图片失败,默认图片
- bind_bnerr2: function (e) {
+ bind_bnerr2: function(e) {
var _errImg = e.target.dataset.errorimg;
var _errurl = e.target.dataset.url;
- var _errObj = {};
- _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
- this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
-
+ var _errObj = {};
+ _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
+ this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+
},
-//图片失败,默认图片
- bind_bnerr3: function (e) {
+ //图片失败,默认图片
+ bind_bnerr3: function(e) {
var _errImg = e.target.dataset.errorimg;
var _Img = e.target.dataset.img;
if (_Img != undefined) {
@@ -430,7 +486,7 @@ Page({
//----秒杀倒计时函数-----
countDown() {
- if(!this.data.is_timer) return false;
+ if (!this.data.is_timer) return false;
var th = this;
// 获取当前时间,同时得到活动结束时间数组
var newTime = ut.gettimestamp();
@@ -479,7 +535,7 @@ Page({
//----拼单倒计时函数-----
countDown2() {
- if(!this.data.is_timer) return false;
+ if (!this.data.is_timer) return false;
var th = this;
// 获取当前时间,同时得到活动结束时间数组
@@ -529,123 +585,179 @@ Page({
setTimeout(th.countDown2, 1000);
},
- bannerSwiperChange:function (e) {
- var index=e.detail.current;
- this.setData({banner_index:index});
+ bannerSwiperChange: function(e) {
+ var index = e.detail.current;
+ this.setData({
+ banner_index: index
+ });
},
- flashSwiperChange:function (e) {
- var index=e.detail.current;
- this.setData({flash_index:index});
+ flashSwiperChange: function(e) {
+ var index = e.detail.current;
+ this.setData({
+ flash_index: index
+ });
},
- ptSwiperChange:function (e) {
- var index=e.detail.current;
- this.setData({pt_index:index});
+ ptSwiperChange: function(e) {
+ var index = e.detail.current;
+ this.setData({
+ pt_index: index
+ });
},
Interval_pt() {
- var th=this;
- this.data.pt_timer=setInterval(function () {
- var item=ut.get_rand_item(th.data.pt_timer_arr);
- th.setData({pt_timer_active:1,pt_timer_item:item});
- setTimeout(function () {
- th.setData({pt_timer_active:0});
- },1500)
- },4000);
+ var th = this;
+ this.data.pt_timer = setInterval(function() {
+ var item = ut.get_rand_item(th.data.pt_timer_arr);
+ th.setData({
+ pt_timer_active: 1,
+ pt_timer_item: item
+ });
+ setTimeout(function() {
+ th.setData({
+ pt_timer_active: 0
+ });
+ }, 1500)
+ }, 4000);
},
//---扫一扫的函数---
- getScancode: function () {
+ getScancode: function() {
var _this = this;
// 允许从相机和相册扫码
wx.scanCode({
success: (res) => {
- var result = res.result;
- wx.navigateTo({
- url: "/pages/goods/search/search?s_key="+result,
- });
+ var result = res.result;
+ wx.navigateTo({
+ url: "/pages/goods/search/search?s_key=" + result,
+ });
}
})
},
//跳转到分类
- go_cate:function(){
+ go_cate: function() {
getApp().goto("/pages/goods/categoryList/categoryList");
},
- go_url:function(e){
- var url=e.currentTarget.dataset.url;
- getApp().goto(url);
+ go_url: function(e) {
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
},
- bind_bnerr_icon:function (e) {
+ bind_bnerr_icon: function(e) {
var def = "/miniapp/images/no_cate_def.png";
var _err = e.currentTarget.dataset.err;
- var ob={};
- ob[_err]=def;
+ var ob = {};
+ ob[_err] = def;
this.setData(ob);
},
//跳转到分类的商品列表
- go_cate2: function (t) {
+ go_cate2: function(t) {
var cid = t.currentTarget.dataset.cid;
var pid = t.currentTarget.dataset.pid;
var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid;
- wx.navigateTo({ url: lurl });
- },
-
- //跳转到权益
- go_quanyi:function(t){
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({ url: '/pages/getphone/getphone', })
- return false;
- }
- getApp().goto("/pages/user/userqy/userqy");
- },
-
- imageLoad:function (e) {
- var imgwidth = e.detail.width;
- var imgheight = e.detail.height;
- //宽高比
- var ratio = imgwidth / imgheight;
- //计算的高度值
- var viewHeight = 715 / ratio;
- if(this.data.max_sw_height {
- // var swiperimage = th.data.swiperimage;
- // swiperimage.push("/api/weshop/marketing/newpeople/act/bound/judge");
- // if (res.data.code == 0) {
- // th.setData({
- // is_disgraceful:1
- // })
- // }
- // })
-
- // getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", {
- // data: {
- // storeId: o.stoid,
- // userId: d.user_id
- // }
- // }).then(res => {
- // var swiperimage = th.data.swiperimage;
- // swiperimage.push("/miniapp/images/newpeople/newpeople.png");
- // if (res.data.code == 0) {
- // th.setData({
- // swiperimage: swiperimage
- // })
- // }
- // })
+ is_new: function() {
+ var th = this;
+ wx.hideLoading();
+ getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", {
+ data: {
+ storeId: os.stoid,
+ userId: d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var actid = res.data.data.id; //活动id
+ var giftBagId = res.data.data.giftBagId; //礼包id
+ var new_nav = "/pages/giftpack/newvipgift/newvipgift?actId=" + actid + '&' + 'actType=' + 1 + '&' + 'giftBagId=' + giftBagId;
+ var new_image = res.data.data.imageurl;
+ var swiperimage = th.data.swiperimage;
+ var img = {
+ image: "/miniapp/images/newpeople/newpeople.png",
+ nav_url: new_nav
+ }
+ swiperimage.unshift(img);
+ th.setData({
+ swiperimage: swiperimage,
+ new_image: new_image,
+ new_nav: new_nav
+ })
- }
+ getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/bound/judge", {
+ data: {
+ storeId: o.stoid,
+ userId: d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ th.setData({
+ is_disgraceful: 1
+ })
+ }
+ })
+ }
+ })
+ },
+ is_festival: function(e) {
+ var th = this;
+ var url = "/api/weshop/marketing/holiday/act/judge";
+ getApp().request.promiseGet(url, {
+ data: {
+ storeId: os.stoid,
+ userId: d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var actid = res.data.data.id; //活动id
+ var giftBagId = res.data.data.gifBagId; //礼包id
+ var nav_url = "/pages/giftpack/festival/festival?actId=" + actid + '&' + 'actType=' + 3 + '&' + 'giftBagId=' + giftBagId;
+ var swiperimage = th.data.swiperimage;
+ var actImg = res.data.data.actImg;
+ var img = {
+ image: actImg,
+ nav_url: nav_url
+ }
+ swiperimage.unshift(img);
+ th.setData({
+ swiperimage: swiperimage,
+ new_nav: nav_url
+ })
+ }
+ })
+ }
});
\ No newline at end of file
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index 94e19af..b512855 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -108,14 +108,13 @@
-
-
+
-
+
@@ -347,9 +346,9 @@
-
+
-
+
diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss
index 8a2e497..8c7514a 100644
--- a/pages/index/index/index.wxss
+++ b/pages/index/index/index.wxss
@@ -451,6 +451,7 @@
.xc-title-img {
height: 220rpx;
width: 100%;
+ border-radius: 15rpx;
}
.title-img-frame {
@@ -906,5 +907,5 @@
}
.swiper{
height: 250rpx;
- padding-bottom:10rpx;
+ padding-bottom:30rpx;
}
\ No newline at end of file
diff --git a/pages/user/add_comment/add_comment.js b/pages/user/add_comment/add_comment.js
index ba233b8..2d02b6b 100644
--- a/pages/user/add_comment/add_comment.js
+++ b/pages/user/add_comment/add_comment.js
@@ -8,7 +8,6 @@ Page({
resourceUrl: a.resourceUrl,
iurl: a.imghost,
defaultPhoto: a.resourceUrl + "/static/images/camera.png",
-
uploadPath: [], //上传后文件路径
maxWord: 0,
is_anonymous: !1,
@@ -20,7 +19,9 @@ Page({
isLongPress: !1,
userinfo: null,
imgs: [], //本地文件再上传时的路径
- lenMore:0
+ lenMore:0,
+ goods_id: "", //商品id
+ order_id: "", //订单id
},
onLoad: async function (a) {
var th = this;
@@ -35,6 +36,10 @@ Page({
console.log(e);
th.setData({userinfo: e})
})
+ th.setData({
+ goods_id: a.goods_id,
+ order_id: a.order_id
+ })
},
keyUpChangeNum: function (t) {
this.setData({
@@ -79,7 +84,7 @@ Page({
});
});
},
- submitComment: function () {
+ submitComment: function (i) {
var a = this;
if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank)
return getApp().my_warnning("请先打分",0,a);
@@ -111,9 +116,15 @@ Page({
e.post("/api/weshop/comment/savecomment", {
data:p_data,
success: function (a) {
+ if(a.data.code==0){
wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () {
- wx.navigateBack();
+ // wx.navigateBack();
+ var url = i.currentTarget.dataset.url;
+ getApp().goto(url);
});
+ }else{
+ getApp().my_warnning(a.data.msg,0,a);
+ }
}
});
//});
diff --git a/pages/user/add_comment/add_comment.wxml b/pages/user/add_comment/add_comment.wxml
index e4f7f9f..71d1232 100644
--- a/pages/user/add_comment/add_comment.wxml
+++ b/pages/user/add_comment/add_comment.wxml
@@ -106,7 +106,7 @@
- 提交评价
+ 提交评价
diff --git a/pages/user/assistance/assistance.js b/pages/user/assistance/assistance.js
new file mode 100644
index 0000000..df28cf6
--- /dev/null
+++ b/pages/user/assistance/assistance.js
@@ -0,0 +1,152 @@
+var t = getApp(),
+ a = t.request,
+ o = t.globalData.setting,
+ os = o,
+ i = require("../../../utils/util.js"),
+ ut = i,
+ s = require("../../../utils/common.js");
+var regeneratorRuntime = require('../../../utils/runtime.js');
+var oo = t.globalData.setting,os=oo, ut= require("../../../utils/util.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url: os.url, //接口网址
+ iurl: os.imghost, //图片前缀网址
+ switch_head: 0, //0:我的任务,1:活动说明
+ zl_act: null, //助力活动
+ zl_user_list: [], //任务列表
+ is_load: 0, //是否已经加载
+ cur_page: 1, //页码
+ page_num: 5, //每页多少个
+ is_show_more: 0, //是否加载更多
+ help_id:"",//助力活动的id
+ timer:"",//任务列表的定时器
+ s_num:"",//多少人已经领取任务
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var th = this;
+ var nav_b = th.selectComponent("#nav_b"); //组件的id
+ nav_b.set_name("助力", "");
+ // 助力活动
+ this.assistance();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ var th=this;
+ this.data.timer= setInterval(function () {
+ th.get_list();
+
+ },2000)
+
+ },
+ // 助力活动
+ assistance() {
+ var th=this;
+ var user_id = getApp().globalData.user_id;
+ var store_id = os.stoid;
+
+ getApp().request.promiseGet("/api/weshop/marketing/help/act/judge", {
+ data: {
+ storeId: store_id,
+ userId: user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+
+ var help_data=res.data.data;
+ console.log(help_data.id,'数据', res.data.data);
+ th.setData({ zl_act:help_data, help_id:help_data.id });
+ return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
+ data: {
+ helpId: help_data.id, storeId: store_id
+ }
+ })
+
+ }
+ return ut.null_promise();
+ }).then(res=>{
+ if(res.data.code==0)
+ th.setData({s_num:res.data.data.countAll})
+ })
+
+
+ },
+
+ //--点击获取用户任务列表--会员的任务列表
+ get_list:function() {
+ var th = this;
+ var help_id=this.data.help_id;
+ t.request.get("/api/weshop/marketing/help/help/user/page", {
+ data: {
+ userId:getApp().globalData.user_id,
+ storeId: os.stoid,
+ helpId: help_id
+ },
+ success: function(res) {
+ clearTimeout(th.data.timer);
+
+ if (!th.data.is_load) th.setData({
+ is_load: 1
+ })
+ if (res.data.code == 0) {
+
+ var list = th.data.zl_user_list;
+ list = list.concat(res.data.data.pageData) //连接数组
+ th.setData({
+ zl_user_list: list
+ });
+ var n_all_num = th.data.cur_page * th.data.page_num;
+ if (res.data.data.total > n_all_num) th.setData({
+ is_show_more: 1
+ })
+ else th.setData({
+ is_show_more: 0
+ })
+ //页吗要更新一下
+ th.data.cur_page++;
+ } else {
+ th.setData({
+ is_show_more: 0
+ })
+ }
+
+ }
+ })
+ },
+
+ //-----跳转到领取礼包的页面------
+ go_task: function() {
+ var help_id=this.data.help_id;
+
+ getApp().goto("/pages/user/assistance/task_assistance?help_id="+help_id);
+ },
+ switch_head: function (e) {
+ var th = this;
+ var index = e.currentTarget.dataset.index; //获取当前选择的是任务还是活动说明
+ var switch_head = th.data.switch_head; //0任务,1活动说明
+ if (index != switch_head) {
+ th.setData({
+ switch_head: index
+ })
+ }
+ },
+
+ //关闭导航
+ close: function () {
+ var th = this;
+ var nav_b = th.selectComponent("#nav_b"); //组件的id
+ nav_b.close_box();
+ },
+
+})
\ No newline at end of file
diff --git a/pages/user/assistance/assistance.json b/pages/user/assistance/assistance.json
new file mode 100644
index 0000000..d1cfde4
--- /dev/null
+++ b/pages/user/assistance/assistance.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "好友助力",
+ "navigationStyle": "custom",
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm",
+ "nav_b": "/components/nav_b/nav_b"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/assistance/assistance.wxml b/pages/user/assistance/assistance.wxml
new file mode 100644
index 0000000..eb5cf9b
--- /dev/null
+++ b/pages/user/assistance/assistance.wxml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+ 机会总是留给最有行动力的人
+
+
+
+
+
+ 活动时间:
+ {{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}}
+
+
+
+
+ 立即领取
+
+
+
+
+
+
+
+
+
+
+
+ 我的任务
+
+
+
+ 活动说明
+
+
+
+
+
+
+
+
+ {{item.help_taskname}}
+
+
+
+
+ 领取礼包
+
+
+ {{item.helped}}/{{item.help_num}}
+
+
+ 查看礼包
+
+
+
+
+
+
+
+
+ 点击加载更多
+
+
+
+
+
+
+
+
+ 暂无任务记录
+
+
+
+ 已有
+ {{s_num}}
+ 人领取了任务
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/assistance/assistance.wxss b/pages/user/assistance/assistance.wxss
new file mode 100644
index 0000000..39bf1cd
--- /dev/null
+++ b/pages/user/assistance/assistance.wxss
@@ -0,0 +1,132 @@
+page {
+ background-color: rgb(208, 17, 25);
+ width: 100%;
+ height: 100%;
+}
+
+.lumi {
+ position: absolute;
+ z-index: 0;
+ width: 100%;
+ height: 1100rpx;
+}
+
+.zindex {
+ position: absolute;
+ z-index: 1;
+ width: 100%;
+}
+
+.top {
+ padding-bottom: 75rpx;
+}
+
+.getgift {
+ width: 610rpx;
+ height: 130rpx;
+ padding-top: 70rpx;
+}
+
+.excitation {
+ padding-top: 30rpx;
+ color: rgb(255, 255, 255);
+ padding-bottom: 50rpx;
+}
+
+.gift {
+ width: 550rpx;
+ height: 500rpx;
+}
+
+.time {
+ color: rgb(255, 255, 255);
+ margin-bottom: 55rpx;
+ text-decoration: underline;
+ margin-top: 10rpx;
+}
+
+.take {
+ width: 440rpx;
+ height: 77rpx;
+ color: rgb(221, 45, 8);
+ background-color: rgb(252, 210, 10);
+ border-radius: 45rpx;
+ font-weight: 900;
+ line-height: 77rpx;
+ box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6);
+ font-size: 38rpx;
+}
+
+.head {
+ border-bottom: 4rpx solid rgb(253, 193, 7);
+ color: rgb(255, 255, 255);
+ height: 50rpx;
+ line-height: 50rpx;
+}
+
+.lhead {
+ border-top: 4rpx solid rgb(253, 193, 7);
+ border-left: 4rpx solid rgb(253, 193, 7);
+ border-right: 4rpx solid rgb(253, 193, 7);
+ width: 290rpx;
+ height: 50rpx;
+ line-height: 50rpx;
+}
+
+.rhead {
+ background-color: rgb(253, 193, 7);
+ border-bottom: 4rpx solid rgb(253, 193, 7);
+}
+
+.items {
+ padding-top: 50rpx;
+}
+
+.explain {
+ width: 30rpx;
+ height: 30rpx;
+ margin-right: 10rpx;
+}
+
+.padding {
+ padding: 0rpx 50rpx;
+}
+
+.content {
+ padding-bottom: 35rpx;
+}
+
+.width {
+ width: 290rpx;
+}
+
+.line {
+ width: 110rpx;
+ border-top: 2rpx solid rgb(255, 255, 255);
+}
+
+.loads {
+ margin-bottom: 35rpx;
+}
+
+.load {
+ margin: 0rpx 26rpx;
+}
+
+.item {
+ margin-bottom: 35rpx;
+}
+
+.state {
+ text-decoration: underline;
+}
+.nostate{
+ color: rgb(195,155,156);
+}
+.nothing {
+ padding: 50rpx 0rpx;
+}
+
+.receive {
+ padding-bottom: 50rpx;
+}
diff --git a/pages/user/assistance/assistance_success.js b/pages/user/assistance/assistance_success.js
new file mode 100644
index 0000000..f09db9a
--- /dev/null
+++ b/pages/user/assistance/assistance_success.js
@@ -0,0 +1,75 @@
+var auth = require("../../../utils/auth.js"), rq = require("../../../utils/request.js");
+var e = getApp(), app = e, s = e.globalData.setting, os = s, app_d = e.globalData;
+var regeneratorRuntime = require('../../../utils/runtime.js');
+var ut = require("../../../utils/util.js");
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ iurl: s.imghost,
+ user:app_d.userInfo,
+ zl_act:null, //助力活动
+ s_num:0, //分享的人数
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function (options) {
+ //var helpid=options.helpid;
+ var helpid=23;
+ this.init(helpid);
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function (e) {
+
+ },
+
+ // ----初始化----
+ init:function(helpid) {
+ var user_id = getApp().globalData.user_id;
+ var store_id = os.stoid;
+ var th=this;
+
+ //链式调用接口,先获取活动,在获取参与活动的人数
+ getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
+ data: {
+ storeId: store_id,
+ helpId: helpid
+ }
+ }).then(res => {
+ if(res.data.code==0){
+ th.setData({zl_act:res.data.data});
+ return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
+ data: {
+ storeId: store_id,
+ helpId: helpid
+ }
+ })
+ }
+ return ut.null_promise();
+
+ }).then(res=>{
+ if(res.data.code==0){
+ th.setData({s_num:res.data.data.countAll});
+ }
+ })
+
+ },
+
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ cklie_button:function(){
+ getApp().goto("/pages/user/assistance/assistance")
+ }
+})
\ No newline at end of file
diff --git a/pages/user/assistance/assistance_success.json b/pages/user/assistance/assistance_success.json
new file mode 100644
index 0000000..5467480
--- /dev/null
+++ b/pages/user/assistance/assistance_success.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm",
+ "nav_b": "/components/nav_b/nav_b"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/assistance/assistance_success.wxml b/pages/user/assistance/assistance_success.wxml
new file mode 100644
index 0000000..06afae6
--- /dev/null
+++ b/pages/user/assistance/assistance_success.wxml
@@ -0,0 +1,25 @@
+
+
+
+
+ {{user.nickname}}
+
+ 助力成功,自己也差拆一个吧~
+
+
+
+
+
+
+
+ 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.endDate)}}
+
+
+
+我也要参加
+已有{{s_num}}人领取礼盒
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/assistance/assistance_success.wxss b/pages/user/assistance/assistance_success.wxss
new file mode 100644
index 0000000..a7130a5
--- /dev/null
+++ b/pages/user/assistance/assistance_success.wxss
@@ -0,0 +1,61 @@
+page{
+ background: #d01119;
+ width: 100%;
+ height: 100%
+
+}
+.top-back{
+ width: 100%;
+ height: 60%;
+ background-repead:no-repead;
+ background-size:100% 100%;
+
+}
+.user_img{
+ width: 70rpx;
+ height: 70rpx;
+ margin-right: 15rpx;
+
+}
+.user_assis{
+ width: 85%;
+ margin: auto;
+ padding-top: 50rpx;
+}
+.caption_title{
+ margin-top: 60rpx;
+ margin-bottom: 30rpx;
+}
+.assis_liba{
+ width: 50%;
+ margin: auto;
+ height: 340rpx;
+
+}
+.activity_time{
+ border-bottom: 1rpx solid #fff;
+ margin: auto;
+ display: inline;
+}
+.cklie_button{
+ margin: auto;
+ width: 60%;
+ height: 80rpx;
+ border-radius: 50rpx;
+ margin-top: 20rpx;
+ background: #fbda0e;
+ color:#d01119;
+ line-height: 80rpx;
+ letter-spacing: 5rpx;
+ box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6);
+ font-size: 44rpx;
+ margin-bottom: 40rpx;
+}
+.con_div{
+z-index: 15;
+position: fixed;
+top: 0;
+left: 0;
+height: 100%;
+width: 100%;
+}
\ No newline at end of file
diff --git a/pages/user/assistance/c_filter.wxs b/pages/user/assistance/c_filter.wxs
new file mode 100644
index 0000000..b57d4fa
--- /dev/null
+++ b/pages/user/assistance/c_filter.wxs
@@ -0,0 +1,16 @@
+var filters = {
+ toFix:function(val,count){
+ return val.toFixed(count)
+ },
+ fm_time:function(ts) {
+ var d = getDate(ts*1000)
+ var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日";
+ return fm;
+ },
+
+}
+
+module.exports = {
+ toFix: filters.toFix,
+ fm_time:filters.fm_time,
+}
\ No newline at end of file
diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js
new file mode 100644
index 0000000..5d6217f
--- /dev/null
+++ b/pages/user/assistance/friend_assistance.js
@@ -0,0 +1,152 @@
+var auth = require("../../../utils/auth.js"),
+ rq = require("../../../utils/request.js");
+var e = getApp(),
+ app = e,
+ s = e.globalData.setting,
+ os = s,
+ app_d = e.globalData;
+var regeneratorRuntime = require('../../../utils/runtime.js');
+var ut = require("../../../utils/util.js");
+
+Page({
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ iurl: s.imghost,
+ is_show: 0, //显示弹框
+ user: app_d.userInfo,
+ zl_act: null, //助力活动
+ tasking: 0, //助力任务ID
+ userId: 0, //任务用户的ID
+ s_num: 0, //分享的人数
+ taskId:0, //活动从表ID
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var th = this;
+ if (options.tasking) this.data.tasking = options.tasking;
+ if (options.userId) this.data.userId = options.userId;
+ //任务是不是为空
+ if (this.data.tasking == 0 || this.data.tasking == undefined) {
+ //this.data.task_id = decodeURIComponent(options.scene);
+ this.data.tasking =1;
+ if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking !=
+ 0) {
+ getApp().request.promiseGet("/api/weshop/marketing/help/help/tasking/get", {
+ data: {
+ id: th.data.tasking,
+ storeId: os.stoid
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ th.data.userId = res.data.data.userId;
+ th.data.taskId = res.data.data.taskId;
+ //获取活动的时间
+ return getApp().request.promiseGet("/api/weshop/marketing/help/help/act/get", {
+ data: {
+ helpId: res.data.data.helpFormId,
+ storeId: os.stoid
+ }
+ })
+ }
+ return ut.null_promise();
+ }).then(res => {
+ if (res.data.code == 0) {
+ th.setData({
+ zl_act: res.data.data
+ })
+ //获取活动的参与的人数
+ return getApp().request.promiseGet("/api/weshop/marketing/help/involve/help/act/people/count", {
+ data: {
+ helpId: res.data.data.id,
+ storeId: os.stoid
+ }
+ })
+ }
+ return ut.null_promise();
+ }).then(res => {
+ if (res.data.code == 0) {
+ th.setData({
+ s_num: res.data.data.countAll
+ });
+ }
+ })
+
+ }
+ }
+ },
+
+
+ // 跳转到助力成功页
+ participate_activity: function() {
+ wx.navigateTo({
+ url: '/pages/user/assistance/assistance_success',
+ })
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+ //点击开启礼盒
+ cklie_button: function() {
+ var th = this;
+ var t_user_id = app_d.user_id;
+ var data = {
+ id: this.data.tasking,
+ storeId: os.stoid,
+ userId: this.data.userId,
+ zlUserId: t_user_id
+ };
+ console.log(data);
+ getApp().request.json_post("/api/weshop/marketing/help/help/task/involve/insert",
+ data, //入参
+ function(res) { //成功
+ if (res.data.code == 0)
+ th.setData({
+ is_show: 1
+ });
+ else {
+ getApp().my_warnning(res.data.msg, 0, th)
+ }
+ },
+ function() { //失败
+
+ }
+ )
+
+ },
+ //点击关闭礼盒
+ clike_none: function() {
+ this.setData({is_show: 0});
+ getApp().goto("/pages/user/assistance/assistance_success");
+ },
+ //导航球
+ close: function() {
+ var th = this;
+ var nav_b = th.selectComponent("#nav_b"); //组件的id
+ nav_b.close_box();
+ nav_b.set_name("助力", "");
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ },
+
+})
diff --git a/pages/user/assistance/friend_assistance.json b/pages/user/assistance/friend_assistance.json
new file mode 100644
index 0000000..2ee27f1
--- /dev/null
+++ b/pages/user/assistance/friend_assistance.json
@@ -0,0 +1,7 @@
+{
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm",
+ "nav_b": "/components/nav_b/nav_b"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/assistance/friend_assistance.wxml b/pages/user/assistance/friend_assistance.wxml
new file mode 100644
index 0000000..e96ff62
--- /dev/null
+++ b/pages/user/assistance/friend_assistance.wxml
@@ -0,0 +1,39 @@
+
+
+
+
+ {{user.nickname}}
+
+
+ 拜托拜托,帮我拆礼盒得好礼~
+
+
+
+
+
+
+
+
+ 活动时间:{{filter.fm_time(zl_act.beginDate)}}-{{filter.fm_time(zl_act.beginDate)}}
+
+
+
+帮他拆礼盒
+已有{{s_num}}人领取礼盒
+
+
+
+
+
+ 我也要参加
+
+ 已成功帮你的小伙伴助力!
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/assistance/friend_assistance.wxss b/pages/user/assistance/friend_assistance.wxss
new file mode 100644
index 0000000..28e3b98
--- /dev/null
+++ b/pages/user/assistance/friend_assistance.wxss
@@ -0,0 +1,107 @@
+page{
+ background: #d01119;
+ width: 100%;
+ height: 100%
+
+}
+.top-back{
+ width: 100%;
+ height: 60%;
+ background-repead:no-repead;
+ background-size:100% 100%;
+
+}
+.user_img{
+ width: 70rpx;
+ height: 70rpx;
+ margin-right: 15rpx;
+
+}
+.user_assis{
+ width: 85%;
+ margin: auto;
+ padding-top: 50rpx;
+}
+.caption_title{
+ margin-top: 60rpx;
+ margin-bottom: 30rpx;
+}
+.assis_liba{
+ width: 50%;
+ margin: auto;
+ height: 340rpx;
+
+}
+.activity_time{
+ border-bottom: 1rpx solid #fff;
+ margin: auto;
+ display: inline;
+}
+.cklie_button{
+ margin: auto;
+ width: 60%;
+ height: 80rpx;
+ border-radius: 50rpx;
+ margin-top: 20rpx;
+ background: #fbda0e;
+ color:#d01119;
+ line-height: 80rpx;
+ letter-spacing: 5rpx;
+ box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6);
+ font-size: 44rpx;
+ margin-bottom: 40rpx;
+}
+.con_div{
+z-index: 15;
+position: fixed;
+top: 0;
+left: 0;
+height: 100%;
+width: 100%;
+}
+.layer-img{
+ width: 100%;
+ height: 515rpx;
+ background-repead:no-repead;
+ background-size:100% 100%;
+}
+.libao_frame{
+z-index: 15;
+position: fixed;
+width: 70%;
+top: 37.5%;
+left: 50%;
+transform: translate(-50%, -50%);
+height: auto;
+
+}
+.button-img{
+ width: 60%;
+ margin: auto;
+ color: #d01119;
+ height: 75rpx;
+ line-height: 72rpx;
+ background-repead:no-repead;
+ background-size:100% 100%;
+ position: absolute;
+ left: 19%;
+ bottom: 43%;
+}
+.success{
+ position: absolute;
+ left: 23%;
+ bottom: 36%;
+}
+.link_div{
+ width: 3rpx;
+ height: 125rpx;
+ background: #fff;
+ margin: auto;
+
+}
+.close-none{
+width: 70rpx;
+height: 70rpx;
+
+}
+
diff --git a/pages/user/assistance/giftpacklist.js b/pages/user/assistance/giftpacklist.js
new file mode 100644
index 0000000..dc7ffbb
--- /dev/null
+++ b/pages/user/assistance/giftpacklist.js
@@ -0,0 +1,332 @@
+var e = getApp(),
+ a = e.globalData.setting,
+ os = a,
+ t = e.request,
+ d = e.globalData;
+var ut = require("../../../utils/util.js");
+
+Page({
+ data: {
+ url: a.url, //接口网址
+ iurl: a.imghost, //图片前缀网址
+ isBuy: 0,
+ getGiftID: '', //礼包id
+ giftImage: '',
+ giftTitle: '',
+ giftDate: '',
+ giftPrice: '',
+ giftIntegral: '',
+ giftPosPrice: '',
+ giftQty: '',
+ giftRemark: '',
+ giftType: '',
+ actTitle: '',
+ getUrl: '',
+ wareCard: [],
+ orderSn: "", //订单编号
+ lbId: "",
+ code: "", //核销码
+ c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
+ is_lb: 0, //是否有礼包
+ },
+ onLoad: function (options) {
+ var th = this;
+ th.setData({
+ isBuy: options.isBuy,
+ getStorageID: a.stoid,
+ getUserID: d.user_id,
+ getGiftID: options.lbId,
+ orderSn: options.orderSn
+ })
+ if (options.isBuy == 0) {
+ th.GetMyGiftList();
+ } else {
+ th.GetBuyGiftList();
+ }
+ th.setData({
+ giftRemark: th.data.giftRemark.replace(/![]()
+
+
+
+
+
+ {{giftTitle}}
+
+
+ {{"兑换截至时间:"+giftDate}}
+
+
+
+ {{"¥"+giftPrice}}
+
+
+ /
+
+
+ {{giftIntegral+"积分"}}
+
+
+ {{actTitle}}
+
+
+
+
+
+
+ 礼包内容
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.couponName}}
+
+
+
+
+
+ {{"数量:"+item.num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 奖励已发放
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/assistance/giftpacklist.wxss b/pages/user/assistance/giftpacklist.wxss
new file mode 100644
index 0000000..3d906ad
--- /dev/null
+++ b/pages/user/assistance/giftpacklist.wxss
@@ -0,0 +1,244 @@
+@charset "UTF-8";
+
+/* Author XGQ
+ * 2019-12-12
+ */
+
+.box.data-v-3a5b7e36 {
+ -webkit-align-content: center;
+ align-content: center;
+ background-color: #e85f93;
+}
+
+.box_top.data-v-3a5b7e36 {
+ width: 100%;
+}
+
+.box_top image.data-v-3a5b7e36 {
+ width: 100%;
+ max-height: 540rpx;
+}
+
+.box_title.data-v-3a5b7e36 {
+ margin: 10rpx 20rpx 20rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
+}
+
+.top_title.data-v-3a5b7e36 {
+ font-size: 30rpx;
+ margin-bottom: 10rpx;
+}
+
+.top_time.data-v-3a5b7e36 {
+ font-size: 27rpx;
+ color: #b9b5b5;
+}
+
+.top_price.data-v-3a5b7e36 {
+ font-size: 35rpx;
+ color: #d61b30;
+ margin-top: 30rpx;
+ margin-bottom: 5rpx;
+}
+
+.top_foot.data-v-3a5b7e36 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+}
+
+.top_foot_price.data-v-3a5b7e36 {
+ font-size: 22rpx;
+ color: #b9b5b5;
+ width: 50%;
+ text-decoration: line-through;
+}
+
+.top_foot_qty.data-v-3a5b7e36 {
+ font-size: 22rpx;
+ color: #b9b5b5;
+ width: 50%;
+ -webkit-align-content: flex-end;
+ align-content: flex-end;
+ text-align: right;
+}
+
+.box_ware.data-v-3a5b7e36 {
+ margin: 10rpx 20rpx 20rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
+}
+
+.box_ware_title.data-v-3a5b7e36 {
+ font-size: 35rpx;
+ margin: 5rpx 0rpx 30rpx 0rpx;
+}
+
+.box_ware_box.data-v-3a5b7e36 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 10rpx 0rpx 25rpx 0rpx;
+}
+
+/* .box_ware_img.data-v-3a5b7e36 {
+ width: 30%;
+ height: 180rpx;
+ border: #999999 solid 1rpx;
+} */
+
+.box_ware_img image.data-v-3a5b7e36 {
+ /* width: 185rpx;
+ height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
+ border: 2rpx solid #999;
+ width: 120rpx;
+ height: 120rpx;
+}
+
+.box_ware_item.data-v-3a5b7e36 {
+ width: 70%;
+ margin-left: 25rpx;
+ position: relative;
+}
+
+.box_ware_item_title.data-v-3a5b7e36 {
+ font-size: 24rpx;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
+.box_ware_count.data-v-3a5b7e36 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+}
+
+.box_ware_item_price.data-v-3a5b7e36 {
+ font-size: 25rpx;
+ color: #b9b5b5;
+ position: absolute;
+ bottom: 60rpx;
+ left: 0;
+}
+
+.box_ware_item_qty.data-v-3a5b7e36 {
+ font-size: 22rpx;
+ position: absolute;
+ bottom: 15rpx;
+ left: 0;
+}
+
+.box_ware_code.data-v-3a5b7e36 {
+ position: absolute;
+ right: 10rpx;
+ bottom: 10rpx;
+}
+
+.box_ware_code image.data-v-3a5b7e36 {
+ width: 50rpx;
+ height: 50rpx;
+}
+
+.box_ware_code text.data-v-3a5b7e36 {
+ font-size: 20rpx;
+}
+
+.foot_box.data-v-3a5b7e36 {
+ margin: 10rpx 20rpx 50rpx 20rpx;
+ padding: 35rpx;
+ background-color: #fff;
+ border-radius: 40rpx;
+}
+
+.foot_box_title.data-v-3a5b7e36 {
+ font-size: 35rpx;
+ margin-bottom: 30rpx;
+}
+
+.foot_box_remark.data-v-3a5b7e36 {
+ font-size: 27rpx;
+ line-height: 40rpx;
+}
+
+.foot_empty.data-v-3a5b7e36 {
+ height: 90rpx;
+}
+
+.foot_button.data-v-3a5b7e36 {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ margin: 20rpx 0rpx 0rpx 0rpx;
+ padding: 25rpx 0rpx;
+ background: #fff;
+ text-align: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ justify-content: center;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+}
+
+.foot_button_left.data-v-3a5b7e36 {
+ background: #e4010c;
+ color: #fff;
+ width: 250rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+.foot_button_right.data-v-3a5b7e36 {
+ background: #ffbb42;
+ color: #fff;
+ width: 250rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+.foot_button_buy.data-v-3a5b7e36 {
+ background: #e4010c;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+.foot_button_intalge.data-v-3a5b7e36 {
+ background: #ffbb42;
+ color: #fff;
+ width: 400rpx;
+ height: 70rpx;
+ font-size: 28rpx;
+ line-height: 70rpx;
+ border-radius: 40rpx;
+}
+
+page.data-v-3a5b7e36 {
+ background-color: #e85f93;
+}
+
+.foot_box_remark.data-v-3a5b7e36 ._img {
+ width: 100%;
+}
+
+.foot_box_remark.data-v-3a5b7e36 .img {
+ line-height: 0;
+}
+.overdue.data-v-3a5b7e36{
+ background-color: rgb(153,153,153);
+}
\ No newline at end of file
diff --git a/pages/user/assistance/surplus_time.wxs b/pages/user/assistance/surplus_time.wxs
new file mode 100644
index 0000000..2c3fec2
--- /dev/null
+++ b/pages/user/assistance/surplus_time.wxs
@@ -0,0 +1,7 @@
+var filters = {
+
+ sy_time: function (ts) {
+
+ },
+
+}
diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js
new file mode 100644
index 0000000..3f60597
--- /dev/null
+++ b/pages/user/assistance/task_assistance.js
@@ -0,0 +1,1068 @@
+var auth = require("../../../utils/auth.js"),
+ rq = require("../../../utils/request.js");
+var e = getApp(),
+ app = e,
+ i = require("../../../utils/util.js"),
+ ut = i,
+ s = e.globalData.setting,
+ os = s,
+ app_d = e.globalData;
+var regeneratorRuntime = require('../../../utils/runtime.js');
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ sw_index: 0, //轮播的下标控制
+ url: s.url, //接口网址
+ iurl: s.imghost,
+ endDate: "", //活动结束时间
+ activity_data: "25:20:59", //活动剩余时间
+ task_number: 0, //任务数
+ is_task: 0, //历史记录与任务
+ aitem: "", //活动的轮播图数据
+ switch_head: 0, //0:我的任务,1:记录
+ help_id: "", //活动的id canvasHidden: 0, //分享图片是否已经生成
+ is_share: 1, //是否显示画布
+ shareImgPath: [], //生成的图片
+ screenWidth: "", //用户的屏幕宽度
+ gid: "",
+ timer: null, //全局的定时器
+ user_task_list: null, //会员列表
+ taskid: "", //任务id
+ usercount: 0, //参与的人数
+ dismantle: null, //帮拆记录数据集
+ is_shares:111111,//判断是不是要分享的
+
+ //*********************************************start钱
+ canvasHidden: 0, //分享图片是否已经生成
+ is_share: 0, //是否显示画布
+ shareImgPath: [], //生成的图片
+ screenWidth: "", //用户的屏幕宽度
+ gid: "",
+ images: ["miniapp/images/friendhelp/help.png", "miniapp/images/friendhelp/background.png", "miniapp/images/friendhelp/no_check.png",
+ "miniapp/images/friendhelp/check.png", "miniapp/images/friendhelp/unfinished.png",
+ "/public/upload/libao/temp/2019/12-20/51f251f44ea0f67b8efdc5bfa3a434b0.jpg"
+ ], //固的分享图片
+ dynamic: [], //已助力的微信头像数组
+ is_generate: 0, //是否重复点击拆一拆
+ already: 0, //已有几人助力
+ lack: 0, //还差几人助力
+ zltime: "", //助力时间
+ //*********************************************end
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var help_id = options.help_id;
+ var th = this;
+ th.setData({
+ help_id: help_id
+ });
+ //start 钱
+ if (options.gid != undefined) {
+ th.setData({
+ gid: options.gid
+ })
+ }
+ th.close();
+ th.syinfo();
+ // th.imageinfo();
+ //end
+ },
+
+
+ //选中任务保存
+ add_onlicke: function(e) {
+ var th = this;
+ var taskid = e.target.dataset.taskid;
+ var help_id = th.data.help_id;
+ var user_id = getApp().globalData.user_id;
+ var stoid = os.stoid
+ getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", {
+ helpId: help_id,
+ userId: user_id,
+ storeId: stoid,
+ taskId: taskid
+ },
+ function(res) {
+
+ if (res.data.code == 0) {
+ console.log(res.data.data);
+ getApp().my_warnning(res.data.data, 1, th);
+ } else {
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ }
+
+ )
+
+ },
+
+
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+ this.data.is_timer = 1;
+ var th = this;
+ var help_id = th.data.help_id;
+ var user_id = getApp().globalData.user_id;
+
+ /*-----助力活动(判断)-----*/
+ rq.get("/api/weshop/marketing/help/act/judge", {
+ data: {
+ userId: user_id,
+ storeId: os.stoid
+ },
+ success: function(res) {
+ if (res.data.code == 0) {
+
+ var help_data = res.data.data;
+ console.log('助力活动(判断)', res.data.data);
+ th.setData({
+ endDate: help_data.endDate,
+ });
+
+ }
+ }
+
+
+ });
+
+
+ /*-----获取助力活动的任务-----*/
+ rq.get("/api/weshop/marketing/help/help/task/page", {
+ data: {
+ helpId: help_id,
+ storeId: os.stoid
+ },
+ success: function(su) {
+ var data = su.data;
+ if (data.code != 0) {
+ getApp().my_warnning(data.msg, 0, th);
+ return false;
+ }
+ if (data.code == 0) {
+ //轮播图的数据
+ var data_aissa = data.data.pageData;
+ //当前时间戳
+ var nt = ut.gettimestamp();
+
+ data_aissa.forEach(function(val, ind) {
+
+ //已开始
+ if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0;
+ //未开始
+ else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1;
+ //已结束
+ else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2;
+ });
+ var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty;
+ var taskid = data_aissa[0].id;
+
+ th.setData({
+ aitem: data_aissa,
+ task_number: task_number,
+ taskid: taskid
+ });
+
+
+ }
+
+ }
+ })
+ // 分享的
+ // setTimeout(function() {
+ // th.shareFrends();
+ // }, 1000)
+ //任务时间 设置全局定时器
+ th.data.timer = setInterval(function() {
+ th.countDown();
+ }, 1000);
+ //会员任务列表
+ this.user_task_list();
+ // 获取会员的参与的任务列表 我的任务
+ this.get_user_task_num();
+
+ },
+
+
+
+
+
+
+ //帮拆记录的
+ dismantle_record: function(e) {
+ var aitem = this.data.aitem; //任务的数据集
+ var sw_index = this.data.sw_index; //轮播的下标
+ //任务id
+ var taskid = aitem[sw_index].id;
+ console.log("任务id", taskid);
+ var th = this;
+ var index = 1; //获取当前选择的是任务还是活动说明
+ var is_task = th.data.is_task; //0任务,1帮拆
+ console.log("0任务,1帮拆", is_task, );
+ th.setData({
+ is_task: 1,
+ switch_head: 1
+ });
+ rq.get("/api/weshop/marketing/help/help/task/involve/page", {
+ data: {
+ taskId: taskid,
+ userId: getApp().globalData.user_id,
+ storeId: os.stoid
+ },
+ success: function(res) {
+
+ if (res.data.code == 0) {
+ var dismantle = res.data.data.pageData;
+ th.setData({
+ dismantle: dismantle
+ });
+ }
+ }
+
+ })
+
+
+ },
+
+
+ //划动的时候监听
+ onSli: function(e) {
+ var th = this;
+ var ind = e.detail.current;
+ var aitem = this.data.aitem;
+ var task_number = aitem[ind].giftQty - aitem[ind].useGiftQty;
+ console.log("划动的任务总数", task_number, "任务所有的参数", aitem);
+ th.setData({
+ sw_index: ind,
+ task_number: task_number
+ });
+ console.log("可以领取的的任务数", aitem[ind].giftQty, '已领取的任务数据', aitem[ind].useGiftQty);
+ },
+ //导航球
+ close: function() {
+ var th = this;
+ var nav_b = th.selectComponent("#nav_b"); //组件的id
+ nav_b.close_box();
+ nav_b.set_name("助力", "");
+ },
+ // 获取会员的参与的任务列表 我的任务
+ user_task_list: function(e) {
+ var th = this;
+
+ var index = 0;
+ var is_task = th.data.is_task; //0任务,1活动说明
+ var help_id = th.data.help_id;
+ var user_id = getApp().globalData.user_id;
+ rq.get("/api/weshop/marketing/help/help/user/page", {
+ data: {
+ helpId: help_id,
+ storeId: os.stoid,
+ userId: user_id
+ },
+ success: function(su) {
+ th.setData({
+ is_task: index,
+ switch_head: index
+ });
+ if (su.data.code == 0) {
+ var user_list = su.data.data.pageData;
+ console.log("会员列表", user_list);
+ th.setData({
+ user_task_list: user_list
+ });
+ } else {
+ th.setData({
+ user_task_list: null
+ });
+ }
+ }
+ })
+ },
+ //获取助力活动参与的人数
+ get_user_task_num() {
+ var th = this;
+ var help_id = th.data.help_id;
+ rq.get("/api/weshop/marketing/help/involve/help/act/people/count", {
+ data: {
+ helpId: help_id,
+ storeId: os.stoid,
+ },
+ success: function(su) {
+ console.log(su.data.code, "获取助力活动参与的人数", su.data)
+ if (su.data.code == 0) {
+ var usercount = su.data.data.countAll;
+
+ th.setData({
+ usercount: usercount
+ });
+ } else {
+
+ }
+ }
+ })
+
+ },
+ //轮播卡死的重置
+ changeGoodsSwip: function(detail) {
+ if (detail.detail.source == "touch") {
+ //当页面卡死的时候,current的值会变成0
+ if (detail.detail.current == 0) {
+ //有时候这算是正常情况,所以暂定连续出现3次就是卡了
+ let swiperError = this.data.swiperError
+ swiperError += 1
+ this.setData({
+ swiperError: swiperError
+ })
+ if (swiperError >= 3) { //在开关被触发3次以上
+ console.error(this.data.swiperError)
+ this.setData({
+ goodsIndex: this.data.preIndex
+ }); //,重置current为正确索引
+ this.setData({
+ swiperError: 0
+ })
+ }
+ } else { //正常轮播时,记录正确页码索引
+ this.setData({
+ preIndex: detail.detail.current
+ });
+ //将开关重置为0
+ this.setData({
+ swiperError: 0
+ })
+ }
+ }
+ },
+
+ // 轮播图点击左边
+ click_pre: function() {
+ console.log("轮播图点击左边");
+ var index = this.data.sw_index;
+ index--;
+ if (index < 0) return;
+ var aitem = this.data.aitem;
+ var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
+ this.setData({
+ sw_index: index,
+ task_number: task_number
+ })
+
+ },
+ //轮播图点击右边
+ click_next: function() {
+
+ var index = this.data.sw_index;
+ index++;
+ console.log("轮播图点击右边");
+ if (index >= this.data.aitem.length) return;
+ var aitem = this.data.aitem;
+ var task_number = aitem[index].giftQty - aitem[index].useGiftQty;
+ this.setData({
+ sw_index: index,
+ task_number: task_number
+ })
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function() {
+ //--清理定时器--
+ console.log("清理定时器");
+ clearInterval(this.timer);
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function() {
+
+ },
+ //----助力任务的时间-----
+ countDown() {
+ if (!this.data.is_timer) return false;
+ var th = this;
+ // 获取当前时间,同时得到活动结束时间数组
+ var newTime = ut.gettimestamp();
+ var List = this.data.aitem;
+ for (var j = 0; j < List.length; j++) {
+ var o = List[j];
+
+ // 对结束时间进行处理渲染到页面
+
+ // var o = endTimeList[i];
+ var endTime = o.endDate
+
+ // if (o.status == 0) endTime = o.start_time
+
+ var obj = null;
+ // 如果活动未结束,对时间进行处理
+ if (endTime - newTime > 0) {
+
+ var time = (endTime - newTime);
+ // 获取天、时、分、秒
+ var day = parseInt(time / (60 * 60 * 24));
+ var hou = parseInt(time % (60 * 60 * 24) / 3600);
+ var min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
+ var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
+ obj = {
+ day: this.timeFormat(day),
+ hou: this.timeFormat(hou),
+ min: this.timeFormat(min),
+ sec: this.timeFormat(sec)
+ }
+ } else {
+
+ //活动已结束,全部设置为'00'
+ obj = {
+ day: '00',
+ hou: '00',
+ min: '00',
+ sec: '00'
+ }
+ }
+ var txt = "aitem[" + j + "]djs";
+ th.setData({
+ [txt]: obj
+ });
+
+
+ }
+ setTimeout(th.countDown, 1000);
+
+ },
+ //---小于10的格式化函数----
+ timeFormat(param) {
+ return param < 10 ? '0' + param : param;
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function() {
+
+ },
+ shareFrends: function(e) {
+ var th = this;
+ var scene = th.data.gid;
+ ///二微码
+ // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ var iurl = th.data.iurl; //图片地址前缀
+ const ctx = wx.createCanvasContext('share_id'); //绘图上下文
+ var unit = th.data.screenWidth / 750 * 1.35;
+ var numsize = 20 * unit; //几人助力字体大小
+ var size = 15 * unit;
+ var num = 10;
+ var q_num = 6;
+ var already = num.toString().length + 1; //已有几位好友助力
+ var lack = q_num.toString().length + 1; //还差几位好友助力
+ var imagesize = 40 * unit; //助力人的图片大小
+ var left = 74 * unit; //助力人头像跟左边的距离
+ var spacing = 12 * unit; //助力人图片间距
+ var images = th.data.images;
+ ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片
+ ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片
+ ctx.drawImage(images[2], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size)
+ ctx.fillText("已有", 77 * unit, 430 * unit);
+ ctx.setFillStyle("#FF4746");
+ ctx.setFontSize(numsize)
+ ctx.fillText(num + "位", 108 * unit, 430 * unit);
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size)
+ ctx.fillText("好友助力,还差", 114 * unit + already * numsize * unit, 430 * unit);
+ ctx.setFillStyle("#FF4746");
+ ctx.setFontSize(numsize);
+ ctx.fillText(q_num + "位", 220 * unit + already * numsize * unit, 430 * unit);
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size);
+ ctx.fillText("达成助力", 248 * unit + lack * numsize * unit + already * numsize - numsize * 2, 430 * unit);
+ var c = q_num / num;
+ ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit, 12 * unit);
+ ctx.drawImage(images[4], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);
+ for (var i = 0; i < 6; i++) {
+ if (i == 0) {
+ ctx.save();
+ ctx.beginPath(); //开始绘制
+ ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);
+ ctx.setLineWidth(4 * unit);
+ ctx.setStrokeStyle('red');
+ ctx.setFillStyle("white");
+ ctx.fill();
+ ctx.clip();
+ ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize);
+ ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制
+ } else {
+ // 助力人的头像
+ ctx.drawImage(images[6], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片
+ }
+ left += imagesize + spacing;
+ }
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit);
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);
+ ctx.drawImage(images[7], 325 * unit, 595 * unit, 77 * unit, 77 * unit); //分享的背景图片
+ ctx.save();
+ //读取文件成功则OK--
+ // wx.getImageInfo({
+ // src: path3,
+ // success: function (res) {
+ //把画板内容绘制成图片,并回调 画板图片路径
+ ctx.draw(false, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 300,
+ height: 500,
+ destWidth: 400 * 2,
+ destHeight: 720 * 2,
+ canvasId: 'share_id',
+ success: function(res) {
+ wx.hideLoading();
+ var shareImgPath = th.data.shareImgPath;
+ shareImgPath[0] = res.tempFilePath;
+
+ th.setData({
+ shareImgPath: shareImgPath,
+ canvasHidden: 1,
+ is_share: 1
+ })
+ if (!res.tempFilePath) {
+ wx.showModal({
+ title: '提示',
+ content: '图片绘制中,请稍后重试',
+ showCancel: false
+ })
+ return false;
+ }
+
+ },
+ fail(r) {
+
+ }
+ }, 500)
+ })
+ })
+ // }
+ // })
+ },
+ preview: function() {
+ var th = this;
+ var shareImgPath = th.data.shareImgPath;
+ wx.previewImage({
+ url: shareImgPath[0],
+ urls: shareImgPath
+ })
+ },
+
+ //关闭分享显示
+ close_share: function() {
+ var th = this;
+ th.setData({
+ is_share: 0
+ })
+ },
+ syinfo: function() {
+ var th = this;
+ //获取用户设备信息,屏幕宽度
+ wx.getSystemInfo({
+ success: res => {
+ th.setData({
+ screenWidth: res.screenWidth
+ })
+ }
+ })
+ },
+ //钱 分享图
+ imageinfo: function() {
+ var th = this;
+ var images = th.data.images;
+ var iurl = th.data.iurl;
+ wx.getImageInfo({
+ src: iurl + images[0],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[0] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[1],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[1] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[2],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[2] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[3],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[3] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[4],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[4] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[5],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[5] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[6],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[6] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ });
+
+ wx.getImageInfo({
+ src: iurl + images[7],
+ success: function(res) {
+ console.log(res + i);
+ //res.path是网络图片的本地地址
+ images[7] = res.path;
+ },
+ fail: function(res) {
+ console.log(res.toString() + "" + i);
+ }
+ })
+ th.setData({
+ images: images
+ })
+
+ },
+ //生成分享图,用于分享给好友帮拆
+ demolition: function() {
+ var th = this;
+
+
+ },
+ //************************ */
+ shareFrends: function(e) {
+ var th = this;
+ var is_generate = th.data.is_generate; //是否重复提交拆一拆
+ if (is_generate == 0) {
+ th.setData({
+ is_generate: 1
+ })
+ var scene = th.data.gid;
+ ///二微码
+ // var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
+ // a.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
+ var iurl = th.data.iurl; //图片地址前缀
+ const ctx = wx.createCanvasContext('share_id'); //绘图上下文
+ var unit = th.data.screenWidth / 750 * 1.35;
+ var numsize = 20 * unit; //几人助力字体大小
+ var size = 15 * unit;
+ var num = th.data.already; //已有几位好友助力
+ var q_num = th.data.lack; //还差几位好友助力
+ var already = num.toString().length + 1; //已有几位好友助力
+ var lack = q_num.toString().length + 1; //还差几位好友助力
+ var imagesize = 40 * unit; //助力人的图片大小
+ var left = 74 * unit; //助力人头像跟左边的距离
+ var spacing = 12 * unit; //助力人图片间距
+ var images = th.data.images;
+ ctx.drawImage(images[0], 0, 0, 445 * unit, 700 * unit); //分享的背景图片
+ ctx.drawImage(images[1], 37 * unit, 185 * unit, 370 * unit, 377 * unit); //分享的背景图片
+ ctx.drawImage(images[5], 90 * unit, 231 * unit, 266 * unit, 160 * unit); //分享的背景图片
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size)
+ ctx.fillText("已有", 77 * unit, 430 * unit);
+ ctx.setFillStyle("#FF4746");
+ ctx.setFontSize(numsize)
+ ctx.fillText(num + "位", 108 * unit, 430 * unit);
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size)
+ ctx.fillText("好友助力,还差", 116 * unit + already * numsize * unit, 430 * unit);
+ ctx.setFillStyle("#FF4746");
+ ctx.setFontSize(numsize);
+ ctx.fillText(q_num + "位", 223 * unit + already * numsize * unit, 430 * unit);
+ ctx.setFillStyle("rgb(221,153,116)");
+ ctx.setFontSize(size);
+ ctx.fillText("达成助力", 230 * unit + lack * numsize * unit + already * numsize * unit, 430 * unit);
+ var c = q_num / num;
+ ctx.drawImage(images[2], 65 * unit, 445 * unit, 320 * unit, 12 * unit);
+ ctx.drawImage(images[3], 65 * unit, 445 * unit, 320 * unit * c, 12 * unit);
+ // var dynamic = th.data.dynamic; //助力的微信头像
+ // console.log(dynamic[0].headPic + "动态图片显示");
+ for (var i = 0; i < 6; i++) {
+ if (i < 0) {
+ // ctx.beginPath();
+ // ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);
+ // ctx.setLineWidth(1);
+ // ctx.setStrokeStyle('red');
+ ctx.save();
+ ctx.beginPath(); //开始绘制
+ ctx.arc(left + imagesize / 2, 505 * unit, imagesize / 2, 0, 2 * Math.PI);
+ ctx.setLineWidth(4 * unit);
+ ctx.setStrokeStyle('red');
+ ctx.setFillStyle("white");
+ ctx.fill();
+ ctx.clip();
+ ctx.drawImage(dynamic[i].headPic, left, 505 * unit - imagesize / 2, imagesize, imagesize);
+ ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 还可以继续绘制
+ } else {
+ // 助力人的头像
+ ctx.drawImage(images[4], left, 505 * unit - imagesize / 2, imagesize, imagesize); //分享的背景图片
+
+ }
+ left += imagesize + spacing;
+ }
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("优惠乐翻天,精彩就在你身边!", 37 * unit, 595 * unit);
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("2019.06.26 - 2019.07.02!", 37 * unit, 620 * unit);
+ ctx.setFillStyle("rgb(255,255,255)");
+ ctx.setFontSize(size);
+ ctx.fillText("长按识别二维码,可帮我助力!", 37 * unit, 660 * unit);
+ ctx.drawImage(images[5], 325 * unit, 585 * unit, 77 * unit, 77 * unit); //分享的背景图片
+ ctx.save();
+ //读取文件成功则OK--
+ // wx.getImageInfo({
+ // src: path3,
+ // success: function (res) {
+ //把画板内容绘制成图片,并回调 画板图片路径
+ ctx.draw(false, function() {
+ setTimeout(function() {
+ wx.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 300,
+ height: 500,
+ destWidth: 400 * 2,
+ destHeight: 720 * 2,
+ canvasId: 'share_id',
+ success: function(res) {
+ wx.hideLoading();
+ var shareImgPath = th.data.shareImgPath;
+ shareImgPath[0] = res.tempFilePath;
+
+ th.setData({
+ shareImgPath: shareImgPath,
+ canvasHidden: 1,
+ is_share: 1,
+ is_generate: 0,
+ canvasHidden: 1
+ })
+ if (!res.tempFilePath) {
+ wx.showModal({
+ title: '提示',
+ content: '图片绘制中,请稍后重试',
+ showCancel: false
+ })
+ return false;
+ }
+
+ },
+ fail(r) {
+
+ }
+ }, 500)
+ })
+ })
+ }
+ },
+ preview: function() {
+ var th = this;
+ var shareImgPath = th.data.shareImgPath;
+ wx.previewImage({
+ url: shareImgPath[0],
+ urls: shareImgPath
+ })
+ th.setData({
+ is_share: 0
+ })
+ },
+
+ //关闭分享显示
+ close_share: function() {
+ var th = this;
+ wx.hideLoading();
+ th.setData({
+ is_share: 0
+ })
+ },
+ syinfo: function() {
+ var th = this;
+ //获取用户设备信息,屏幕宽度
+ wx.getSystemInfo({
+ success: res => {
+ th.setData({
+ screenWidth: res.screenWidth
+ })
+ }
+ })
+ },
+ //把固定的图片加载到本地
+ imageinfo: function() {
+ var th = this;
+ var images = th.data.images;
+ var iurl = th.data.iurl;
+ wx.getImageInfo({
+ src: iurl + images[0],
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ images[0] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[1],
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ images[1] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[2],
+ success: function(res) {
+ //res.path是网络图片的本地地址
+ images[2] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[3],
+ success: function(res) {
+
+ //res.path是网络图片的本地地址
+ images[3] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[4],
+ success: function(res) {
+
+ //res.path是网络图片的本地地址
+ images[4] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ wx.getImageInfo({
+ src: iurl + images[5],
+ success: function(res) {
+
+ //res.path是网络图片的本地地址
+ images[5] = res.path;
+ },
+ fail: function(res) {
+
+ }
+ });
+ th.setData({
+ images: images
+ })
+
+ },
+//好友猜一猜
+ save_share: function (e) {
+ var aitem = this.data.aitem; //任务的数据集
+ var sw_index = this.data.sw_index; //轮播的下标
+ //任务id
+ var taskid = aitem[sw_index].id;
+ console.log("好友猜一猜的任务id", taskid);
+ var th = this;
+
+ var url = "/api/weshop/marketing/help/help/task/involve/page";
+ getApp().request.promiseGet(url, {
+ data: {
+ storeId: 1,
+ taskId: taskid,
+ userId: 1433390
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var data = res.data.data.pageData; //帮拆数组
+ if (data.length > 0) {
+ // th.setData({
+ // dynamic: data
+ // })
+ // th.info_head();
+ th.imageinfo();
+ setTimeout(function () {
+ th.shareFrends();
+ }, 500)
+ }
+ } else {
+ wx.hideLoading();
+ getApp().my_warnning(res.data.msg, 0, th);
+ }
+ })
+ },
+ //把已助力好友头像下载到本地
+ info_head: function (e) {
+ var th = this;
+ var images = th.data.dynamic;
+ if (images[0] != null && images[0] != "" && images[0] != undefined) {
+ console.log(images[0].headPic + "就将计就计");
+ wx.getImageInfo({
+ src: images[0].headPic,
+ success: function (res) {
+ //res.path是网络图片的本地地址
+ images[0].headPic = res.path;
+ },
+ fail: function (res) {
+
+ }
+ });
+ }
+ if (images[1] != null && images[1] != "" && images[1] != undefined) {
+ wx.getImageInfo({
+ src: images[1].headPic,
+ success: function (res) {
+ //res.path是网络图片的本地地址
+ images[1].headPic = res.path;
+ },
+ fail: function (res) {
+
+ }
+ });
+ }
+ if (images[2] != null && images[2] != "" && images[2] != undefined) {
+ wx.getImageInfo({
+ src: images[2].headPic,
+ success: function (res) {
+ //res.path是网络图片的本地地址
+ images[2].headPic = res.path;
+ },
+ fail: function (res) {
+
+ }
+ });
+ }
+ if (images[3] != null && images[3] != "" && images[3] != undefined) {
+ wx.getImageInfo({
+ src: images[3].headPic,
+ success: function (res) {
+ //res.path是网络图片的本地地址
+ images[3].headPic = res.path;
+ },
+ fail: function (res) {
+
+ }
+ });
+ }
+ // if (images[4] != null && images[4] != "" && images[4] != undefined) {
+ // wx.getImageInfo({
+ // src: images[4].headPic,
+ // success: function(res) {
+ // //res.path是网络图片的本地地址
+ // images[4].headPic = res.path;
+ // },
+ // fail: function(res) {
+
+ // }
+ // });
+ // }
+ // if (images[5] != null && images[5] != "" && images[5] != undefined) {
+ // wx.getImageInfo({
+ // src: images[5].headPic,
+ // success: function (res) {
+ // //res.path是网络图片的本地地址
+ // images[5].headPic = res.path;
+ // },
+ // fail: function (res) {
+
+ // }
+ // });
+ //}
+ th.setData({
+ dynamic: images
+ })
+ },
+
+})
\ No newline at end of file
diff --git a/pages/user/assistance/task_assistance.json b/pages/user/assistance/task_assistance.json
new file mode 100644
index 0000000..d1cfde4
--- /dev/null
+++ b/pages/user/assistance/task_assistance.json
@@ -0,0 +1,9 @@
+{
+ "navigationBarTitleText": "好友助力",
+ "navigationStyle": "custom",
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm",
+ "nav_b": "/components/nav_b/nav_b"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml
new file mode 100644
index 0000000..7028232
--- /dev/null
+++ b/pages/user/assistance/task_assistance.wxml
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+ {{aitem[sw_index].helpTaskName}}
+
+
+ 活动剩余时间: {{aitem[0].djs.day}}:{{aitem[0].djs.hou}}:{{aitem[0].djs.min}}:{{aitem[0].djs.sec}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /
+
+
+
+ 今天剩余可领{{task_number}}个任务
+
+
+
+ 就选它了
+
+
+ 好友拆一拆
+
+
+
+
+
+
+
+
+
+
+ 我的任务
+
+
+
+ 帮拆记录
+
+
+
+
+
+
+
+
+
+ {{item.helpTaskName}}
+
+
+
+
+ {{item.zlHelpNum}}/{{item.helpNum}}
+ 查看详情
+ 领取礼包
+
+
+
+
+
+
+
+
+
+
+
+
+ {{itme.nickName}}
+
+ {{filter.format_time(itme.beginDate)}}
+
+
+
+
+
+
+
+
+ 暂无任务记录
+
+
+
+
+
+
+
+
+ 点击加载更多
+
+
+
+ 已有
+ {{usercount}}
+ 人领取了任务
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss
new file mode 100644
index 0000000..c9e1c26
--- /dev/null
+++ b/pages/user/assistance/task_assistance.wxss
@@ -0,0 +1,196 @@
+page{
+ background: #d01119;
+ width: 100%;
+ height: 100%
+
+}
+.top-back{
+ width: 100%;
+ height: 60%;
+ background-repead:no-repead;
+ background-size:100% 100%;
+
+}
+.top-frame{
+ width: 100%;
+ height: auto;
+ padding-top: 50rpx
+}
+.top-title{
+ letter-spacing:10rpx
+}
+.activity-data{
+ padding-top: 10rpx;
+ letter-spacing: 10rpx;
+
+}
+.xc-specific-more-frame{
+ width: 100%;
+ height: 40%;
+
+ margin-top: 20rpx;
+}
+.task-number{
+ margin-top: 50rpx
+}
+.task_clike{
+ margin: auto;
+ width: 60%;
+ height: 65rpx;
+ border-radius: 50rpx;
+ margin-top: 20rpx;
+ background: #fbda0e;
+ color:#d01119;
+ line-height: 65rpx;
+ letter-spacing: 5rpx;
+ box-shadow: 0rpx 7rpx 0rpx 0rpx rgb(245, 119, 6);
+}
+/* 底部列表样式 */
+
+
+.head {
+ border-bottom: 4rpx solid rgb(253, 193, 7);
+ color: rgb(255, 255, 255);
+ height: 48rpx;
+ line-height: 48rpx;
+}
+
+.lhead {
+ border-top: 4rpx solid rgb(253, 193, 7);
+ border-left: 4rpx solid rgb(253, 193, 7);
+ border-right: 4rpx solid rgb(253, 193, 7);
+ width: 290rpx;
+ height: 48rpx;
+ line-height: 48rpx;
+}
+
+.items {
+ padding-top: 50rpx;
+}
+
+.rhead {
+ background-color: rgb(253, 193, 7);
+}
+
+.unfinished {
+ width:35rpx;
+ height: 35rpx;
+ margin-right: 10rpx;
+}
+
+.padding {
+ padding: 0rpx 50rpx;
+}
+
+.width {
+ width: 290rpx;
+}
+
+.line {
+ width: 110rpx;
+ border: 1rpx solid rgb(255, 255, 255);
+}
+
+.load {
+ margin: 0rpx 26rpx;
+}
+
+.item {
+ margin-bottom: 35rpx;
+}
+
+.state {
+ text-decoration: underline;
+}
+
+.nothing {
+ padding: 50rpx 0rpx;
+}
+
+.receive {
+ padding-bottom: 50rpx;
+}
+.xc-center-img{
+ width: 100%;
+ height: 100%
+}
+
+.xc-left{
+ width: 40rpx;
+ height: 40rpx;
+}
+.bcolor {
+border-color: #fff;
+
+}
+.xc-right{
+ width: 40rpx;
+ height: 40rpx;
+}
+.user_img{
+ width: 50rpx;
+ height: 50rpx;
+}
+.dust {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(206, 184, 188, 0.158);
+ z-index: 10;
+}
+
+.closes {
+ margin-top: 20rpx;
+}
+
+.canvas {
+ position: fixed;
+ z-index: 11;
+ width: 100%;
+ top:20rpx;
+}
+
+.close {
+ width: 70rpx;
+ height: 70rpx;
+}
+.plan-frame{
+ width: 86%;
+ margin: auto;
+ margin-top: 50rpx;
+
+}
+.plan-frame .plan_num{
+ width: 90%;
+ background: #ffe7ab;
+ border-radius: 20rpx;
+ height: 22rpx;
+}
+.is_plam{
+ height: 100%;
+ top: 0rpx;
+ left: 0rpx;
+}
+.dust {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ background-color: red;
+ z-index: 10;
+}
+
+.closes {
+ margin-top: 20rpx;
+}
+
+.canvas {
+ position: fixed;
+ z-index: 11;
+ width: 100%;
+ top:20rpx;
+}
+
+.close {
+ width: 70rpx;
+ height: 70rpx;
+}
\ No newline at end of file
diff --git a/pages/user/comment/comment.js b/pages/user/comment/comment.js
index cb15337..87eadde 100644
--- a/pages/user/comment/comment.js
+++ b/pages/user/comment/comment.js
@@ -124,10 +124,11 @@ Page({
//图片失败,默认图片
bind_bnerr2: function(e) {
+ var th = this;
var _errImg = e.currentTarget.dataset.errorimg;
var _errObj = {};
_errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif";
- //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ th.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
},
//预览图片
previewImg: function(e) {
diff --git a/pages/user/comment/comment.wxml b/pages/user/comment/comment.wxml
index 8e578e2..4e77fe1 100644
--- a/pages/user/comment/comment.wxml
+++ b/pages/user/comment/comment.wxml
@@ -7,21 +7,21 @@
-
-
-
-
-
- 当前暂无评价
-
-
- 去首页逛逛
-
+
+
+
+
+
+ 当前暂无评价
+
+
+ 去首页逛逛
+
+
-
-
-
+
+
@@ -66,16 +66,15 @@
@@ -106,12 +105,19 @@
-
- 查看订单
-
-
+
+
+ 查看订单
+
+
+
+
+
+
diff --git a/pages/user/comment/comment.wxss b/pages/user/comment/comment.wxss
index cd0a6ca..3ca00d8 100644
--- a/pages/user/comment/comment.wxss
+++ b/pages/user/comment/comment.wxss
@@ -36,6 +36,7 @@
.border_bottom {
border-bottom: 3rpx solid rgb(245, 245, 245);
}
+
/* 无评价 */
.noCollection image {
@@ -122,14 +123,17 @@
height: 39rpx;
border-radius: 9rpx;
}
-.commodity_evaluate .commodity_To_evaluate view{
+
+.commodity_evaluate .commodity_To_evaluate view {
height: 39rpx;
line-height: 39rpx;
}
-.commodity_evaluate .comment_go{
- margin-top: 10rpx;
- background-color: rgb(211, 28, 52);
+
+.commodity_evaluate .comment_go {
+ margin-left: 20rpx;
+ background-color: rgb(211, 28, 52);
color: rgb(255, 255, 255);
+ border: 2rpx solid rgb(211, 28, 52);
}
.Commodity_spec {
@@ -141,26 +145,30 @@
}
.Commodity_spec view {
- height: 28rpx;
- align-items: center;
+ height: 28rpx;
+ align-items: center;
}
.Commodity_evaluation .Comment_content {
color: rgb(153, 153, 153);
letter-spacing: 1rpx;
}
-.Commodity_evaluation .starss{
- height: 58rpx;
- /* // line-height: 58rpx; */
- align-items: center;
+
+.Commodity_evaluation .starss {
+ height: 58rpx;
+ /* // line-height: 58rpx; */
+ align-items: center;
}
-.Commodity_evaluation .commen{
+
+.Commodity_evaluation .commen {
height: 58rpx;
line-height: 58rpx;
}
-.Commodity_evaluation .starss .stars{
+
+.Commodity_evaluation .starss .stars {
line-height: 58rpx;
}
+
.Commodity_evaluation .starss .stars image {
width: 29rpx;
height: 26rpx;
@@ -173,17 +181,35 @@
margin-right: 8rpx;
margin-top: 18rpx;
border-radius: 6rpx;
- border: 3rpx solid rgb(245, 245, 245);
+ border: 2rpx solid rgb(245, 245, 245);
+ margin-left: 15rpx;
}
-.commodity_evaluate .View_evaluation{
- border:2rpx solid rgb(179, 179, 179);
- color:rgb(0, 0, 0);
+
+.commodity_evaluate .View_evaluation {
+ border: 2rpx solid rgb(179, 179, 179);
+ color: rgb(0, 0, 0);
background-color: rgb(255, 255, 255);
}
-.comment_addtime{
+
+.comment_addtime {
height: 50rpx;
}
-.title_width{ width: 146rpx; text-align:center }
-.shop-font{ color: rgb(153, 153, 153);}
-.reply{ margin-top: 10rpx}
-.get_bottom{ text-align: center; color: #999; margin-bottom: 20rpx}
\ No newline at end of file
+
+.title_width {
+ width: 146rpx;
+ text-align: center;
+}
+
+.shop-font {
+ color: rgb(153, 153, 153);
+}
+
+.reply {
+ margin-top: 10rpx;
+}
+
+.get_bottom {
+ text-align: center;
+ color: #999;
+ margin-bottom: 20rpx;
+}
diff --git a/pages/user/coupons/coupons.wxml b/pages/user/coupons/coupons.wxml
index 938ead2..595edc7 100644
--- a/pages/user/coupons/coupons.wxml
+++ b/pages/user/coupons/coupons.wxml
@@ -34,15 +34,15 @@
{{filter.getNum(detail.Sum)}}元微券
- 微券来源: {{detail.Operator==null?'微信商城':detail.Operator}}
+ 微券来源: {{detail.Operator==null?'微信商城':detail.Operator==''?"微信商城":detail.Operator}}
- 有效期: {{detail.BeginDate==null?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}
+ 有效期: {{(detail.BeginDate==null || detail.BeginDate=='')?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}
有效期:不限
- 使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{detail.UseObjectID==null?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}}
+ 使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}}
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index 9fb079f..61da0e9 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -30,31 +30,36 @@ Page({
cz_val:0,
full_cz_val:0,
is_dengji:0, //是不是等级
+ is_banner:0,//是不是有生日活动
+ giftbagid:"",//生日活动的类型
+ actId:"",//生日活动的id
+ actImg:"",
+ is_assistance:0,//助力活动
},
- goto_service: function () {
+ goto_nav: function (e) {
var th = this;
+ var url = e.currentTarget.dataset.url;
if (th.data.userInfo != null) {
- var url = "/pages/user/my_service/i_service";
getApp().goto(url);
} else {
- if(th.data.is_nav){
wx.navigateTo({
url: '/pages/getphone/getphone',
})
- }
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
-
+ this.birthday();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
+
+ this.is_assistance();
var stoid = app_d.setting.stoid;
var s = this,th=s,need_money=0,cur_g_num=0;
@@ -124,10 +129,12 @@ Page({
await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{
data:{ storeId:os.stoid,userId:app_d.user_id }
}).then(res=>{
- gid=res.data.data.GradeId;
- var cz_val = res.data.data.GradeSum;
- cz_vals=parseInt(cz_val);
- GradeName=res.data.data.GradeName;
+ if (res.data.code == 0 && res.data.data){
+ gid=res.data.data.GradeId;
+ var cz_val = res.data.data.GradeSum;
+ cz_vals=parseInt(cz_val);
+ GradeName=res.data.data.GradeName;
+ }
//th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid});
})
var obj = { cz_val: cz_vals, GradeName:GradeName, is_init: is_init, gradeId: gid };
@@ -253,7 +260,7 @@ Page({
//!this.nomore && this.requestRecommend();
var goods_list = this.selectComponent("#goods_recommend"); //组件的id
goods_list.init();
- setTimeOut(function () { goods_list.get_list(); }, 300)
+ setTimeout(function () { goods_list.get_list(); }, 300)
},
/**
@@ -450,7 +457,58 @@ Page({
jump: function () {
getApp().goto("/pages/user/grow_value/grow_value")
+ },
+ // 判断生日营销的页面是不是存在
+ birthday:function(){
+ var th = this;
+ // rq.get("/api/weshop/marketing/birthday/act/judge", {
+ // data: { storeId: os.stoid, userId: app_d.user_id },
+ // success: function (res) {
+ // var code = res.data.code;
+ // if (code == 0) {
+ // var giftbagid = res.data.data.giftBagId;
+ // var actId = res.data.data.id;
+ // var actImg = res.data.data.actImg;
+ // t.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg });
+ // t.setData({ is_banner: 1 });
+ // }
+
+ // }
+ // })
+
+
+ },
+ clike_banne:function(){
+ var th = this;
+ var actId=th.data.actId;
+ var giftbagid=th.data.giftbagid;
+ if (actId != "" && giftbagid!=""){
+
+ wx.redirectTo({
+ url: "/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3
+ });
+ }else{
+
+ getApp().showWarning("请稍后重试");
+ }
+ },
+ // 判断助力活动是不是存在
+ is_assistance:function(){
+ // var th = this;
+ // rq.get("/api/weshop/marketing/help/act/judge", {
+ // data: { storeId: os.stoid, userId: app_d.user_id },
+ // success: function (res) {
+ // var code = res.data.code;
+ // if (code == 0) {
+ // th.setData({ is_assistance:1});
+ // }
+
+ // }
+ // })
+
}
+
+
})
\ No newline at end of file
diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml
index 75e50a1..5b2764e 100644
--- a/pages/user/index/index.wxml
+++ b/pages/user/index/index.wxml
@@ -166,10 +166,18 @@
+
+
+
+
+
+
+
+
-
+
工具与服务
@@ -212,14 +220,21 @@
我的地址
-
+
我的服务
-
-
- 我的礼包
+
+
+ 专享礼包
+
+
+
+ 助力活动
+
+
+
diff --git a/pages/user/index/index.wxss b/pages/user/index/index.wxss
index 4c04d00..53b652a 100644
--- a/pages/user/index/index.wxss
+++ b/pages/user/index/index.wxss
@@ -344,7 +344,7 @@
.xc-tool-service .xc-tool-service-title {
width: 100%;
height: 90rpx;
- border: 2rpx solid #f2f2f2;
+
}
.xc-tool-service-img {
@@ -361,9 +361,6 @@
width: 100%;
}
-.xc-project-frame .center_v {
-}
-
.xc-project-frame .item {
width: 25%;
margin-top: 30rpx;
@@ -699,3 +696,14 @@
margin-top: 8rpx;
margin-right: 5rpx;
}
+.banner-img{
+ width: 95%;
+ height: 140rpx;
+ border-radius: 10px 10px 0px 0px;
+ margin-bottom: -5rpx;
+
+}
+.banner-frame{
+ width: 100%;
+ background: #f2f2f2;
+}
\ No newline at end of file
diff --git a/pages/user/my_service/tment_eval.js b/pages/user/my_service/tment_eval.js
index 46c8c97..c1b0076 100644
--- a/pages/user/my_service/tment_eval.js
+++ b/pages/user/my_service/tment_eval.js
@@ -23,6 +23,10 @@ Page({
arrangeTime: "", //服务日期
is_evaluate: 0, //是否评价
EvaluateDatetime: "", //评价时间
+ is_act:0, //是否能购获取图片
+ actId:0, //活动ID
+ giftBagId:0, //礼包ID
+
},
//点击星级
check_stars: function(e) {
@@ -219,6 +223,7 @@ Page({
is_evaluate: options.evaluate
})
th.query_bea();
+ th.judge_act();
},
/**
@@ -231,4 +236,46 @@ Page({
th.evaluate_get();
}
},
+ //评价其他跳转
+ evaluate_qt:function(){
+
+ wx.redirectTo({
+ url: "/pages/user/my_service/tment_order_list?state="+2
+ });
+ },
+ //点击领取礼包
+ clike_lb:function(){
+
+ var id=this.data.actId;
+ var gifbagid = this.data.gifbagid;
+ wx.redirectTo({
+ url: "/pages/giftpack/evaluategift/evaluategift?actId=" + id + "&gifbagid=&orderType=2&orderNumber="+this.data.number
+ });
+
+ },
+
+ //--评价有礼判断---
+ judge_act: function () {
+ var th = this;
+ var url = "/api/weshop/marketing/comment/act/judge";
+ getApp().request.promiseGet(url, {
+ data: {
+ orderNumber: th.data.number,
+ orderType: 2,
+ storeId: a.stoid,
+ userId: d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var id = res.data.data.id;
+ var giftbagid = res.data.data.giftbagid;
+ th.setData({
+ is_act: 1,
+ actId: id,
+ giftBagId: giftbagid
+ })
+ }
+ })
+ },
+
})
\ No newline at end of file
diff --git a/pages/user/my_service/tment_eval.wxml b/pages/user/my_service/tment_eval.wxml
index 20dd053..54133a8 100644
--- a/pages/user/my_service/tment_eval.wxml
+++ b/pages/user/my_service/tment_eval.wxml
@@ -91,4 +91,15 @@
确认提交
+
+
+
+
+ 评价其他
+
+
+
+ 点击领取礼品
+
+
\ No newline at end of file
diff --git a/pages/user/my_service/tment_eval.wxss b/pages/user/my_service/tment_eval.wxss
index 2606dc7..8b0b898 100644
--- a/pages/user/my_service/tment_eval.wxss
+++ b/pages/user/my_service/tment_eval.wxss
@@ -115,6 +115,10 @@
background-color: rgb(214, 1, 33);
color: rgb(255, 255, 255);
}
+.Submission.yellow-b{
+ background-color: #ffb03f;
+
+}
.clonri {
margin: 0rpx;
diff --git a/pages/user/my_service/tment_order_list.js b/pages/user/my_service/tment_order_list.js
index 6e0134e..8ad4b7f 100644
--- a/pages/user/my_service/tment_order_list.js
+++ b/pages/user/my_service/tment_order_list.js
@@ -39,7 +39,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
-
+ var state=options.state;
+ if (state != null && state != undefined && state!=""){
+ this.setData({ activeCategoryId: state });
+ }
+
},
changeTab: function(e) {
var th = this;
diff --git a/pages/user/view_comment/view_comment.js b/pages/user/view_comment/view_comment.js
new file mode 100644
index 0000000..95e3fc3
--- /dev/null
+++ b/pages/user/view_comment/view_comment.js
@@ -0,0 +1,127 @@
+var i = require("../../../utils/util.js"),
+ ut = i;
+var e = getApp(),
+ a = e.globalData.setting,
+ os = a,
+ t = e.request,
+ d = e.globalData;
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ url: a.url,
+ iurl: a.imghost,
+ comment: [], //用户单个评价的内容
+ goods_id: "", //商品id
+ order_id: "", //订单id
+ is_act: 0, //是否开启活动
+ actId: "", //活动id
+ giftBagId: "", //礼包id
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var th = this;
+ th.setData({
+ goods_id: options.goods_id,
+ order_id: options.order_id
+ })
+ th.query_comment();
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function() {
+
+ },
+ query_comment: function() {
+ var th = this;
+ wx.showLoading({
+ title: '加载中'
+ })
+ var url = "/api/weshop/comment/list";
+ getApp().request.promiseGet(url, {
+ data: {
+ store_id: a.stoid,
+ userId: d.user_id,
+ goods_id: th.data.goods_id,
+ order_id: th.data.order_id
+ }
+ }).then(res => {
+ wx.hideLoading();
+ if (res.data.code == 0) {
+ var data = res.data.data.pageData;
+ if (data[0].img) data[0].img = ut.unserialize(data[0].img);
+ if (data[0].weapp_img) data[0].weapp_img = JSON.parse(data[0].weapp_img);
+ th.setData({
+ comment: data
+ })
+ th.judge_act(); //判断是否开启评价有礼
+ } else {
+ getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
+ }
+ })
+ },
+ //评价有礼判断
+ judge_act: function() {
+ var th = this;
+ var url = "/api/weshop/marketing/comment/act/judge";
+ getApp().request.promiseGet(url, {
+ data: {
+ orderGoodsId: th.data.goods_id,
+ orderNumber: th.data.order_id,
+ orderType: 1,
+ storeId: a.stoid,
+ userId: d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0) {
+ var id = res.data.data.id;
+ var giftbagid = res.data.data.giftbagid;
+ th.setData({
+ is_act: 1,
+ actId: id,
+ giftBagId: giftbagid
+ })
+ } else {
+
+ }
+ })
+ },
+ //预览图片
+ previewImg: function(e) {
+ var th = this;
+ var index = e.currentTarget.dataset.index;
+ var sindex = e.currentTarget.dataset.sindex;
+ var imgArr = th.data.comment;
+ var image = imgArr[0].weapp_img;
+ var imagename = "";
+ var iurl = th.data.iurl;
+ if (image != "") {
+ image = imgArr[0].weapp_img[index];
+ wx.previewImage({
+ current: iurl + image,
+ //当前图片地址
+ urls: imgArr[0].weapp_img, //所有要预览的图片的地址集合 数组形式
+ })
+ } else {
+ image = imgArr[0].img[index];
+ wx.previewImage({
+ current: iurl + image,
+ //当前图片地址
+ urls: imgArr[0].img, //所有要预览的图片的地址集合 数组形式
+ })
+ }
+ },
+ goto: function(e) {
+ var th = this;
+ var url = e.currentTarget.dataset.url;
+ getApp().goto(url);
+ }
+
+})
\ No newline at end of file
diff --git a/pages/user/view_comment/view_comment.json b/pages/user/view_comment/view_comment.json
new file mode 100644
index 0000000..eacc6fa
--- /dev/null
+++ b/pages/user/view_comment/view_comment.json
@@ -0,0 +1,7 @@
+{
+ "navigationBarTitleText": "查看评价",
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn",
+ "my_confirm": "/components/my_confirm/my_confirm"
+ }
+}
\ No newline at end of file
diff --git a/pages/user/view_comment/view_comment.wxml b/pages/user/view_comment/view_comment.wxml
new file mode 100644
index 0000000..793444c
--- /dev/null
+++ b/pages/user/view_comment/view_comment.wxml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+
+
+ ¥
+ {{item.goods_price}}
+
+
+
+
+ x
+ {{item.goods_num}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 宝贝评分
+
+
+
+
+
+ 描述相符
+
+
+
+
+
+
+
+
+ 物流服务
+
+
+
+
+
+
+
+ 服务态度
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 评价其他
+
+
+ 点击领取礼品
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/view_comment/view_comment.wxss b/pages/user/view_comment/view_comment.wxss
new file mode 100644
index 0000000..ed974d5
--- /dev/null
+++ b/pages/user/view_comment/view_comment.wxss
@@ -0,0 +1,170 @@
+page{
+ overflow-x: hidden;
+}
+/* 商品详情和评价 */
+.commoditymax{
+ overflow-x: hidden;
+}
+.commodity {
+ border-top: 6rpx solid rgb(245, 245, 245);
+ border-bottom: 6rpx solid rgb(245, 245, 245);
+ padding: 0rpx 30rpx;
+ padding-bottom:10rpx;
+}
+
+.commodity .information {
+ height: 286rpx;
+}
+
+.commodity .information image {
+ width: 186rpx;
+ height: 186rpx;
+}
+
+.information .goods_name {
+ width: 480rpx;
+ margin-left: 25rpx;
+ height: 186rpx;
+}
+
+.information .goods_name .ellipsis-2 {
+ line-height: 40rpx;
+ height: 80rpx;
+}
+
+.information .goods_name .jc_sb {
+ margin-top: 60rpx;
+ color: rgb(212, 28, 52);
+ margin-right: 7rpx;
+}
+
+.information .goods_name .jc_sb .fs32 {
+ line-height: 40rpx;
+}
+
+.information .goods_name .jc_sb .sum {
+ margin-right: 5rpx;
+}
+
+.balin {
+ align-items: baseline;
+}
+
+.addComment {
+ width: 690rpx;
+ padding: 32rpx 0rpx 21rpx 0rpx;
+}
+
+.addComment textarea {
+ padding: 0rpx 18rpx;
+ max-height: 100rpx;
+ width: 654rpx;
+}
+
+.addComment .addimages {
+ padding: 0rpx 18rpx;
+ margin-top: 20rpx;
+ align-items: flex-end;
+ width: 652rpx;
+ margin-bottom: 15rpx;
+}
+.comment{
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+}
+.addComment .addimages .images {
+ height: 140rpx;
+}
+
+.addComment .addimages .images .rel {
+ width: 140rpx;
+ height: 100%;
+ overflow: visible;
+ margin-right: 15rpx;
+}
+
+.addComment .addimages .images image .abs {
+ width: 30rpx;
+ height: 30rpx;
+ top: -7rpx;
+ right: -7rpx;
+}
+
+.addComment .addimage {
+ width: 139rpx;
+ height: 139rpx;
+ border: 2rpx dashed rgb(196, 196, 196);
+ font-size: 16rpx;
+ margin-left: 6rpx;
+}
+
+.addComment .addimage image {
+ width: 60rpx;
+ height: 58rpx;
+}
+
+.Grade {
+ width: 100%;
+ height: 310rpx;
+ border-bottom: 6rpx solid rgb(245, 245, 245);
+ padding-left: 45rpx;
+}
+
+.Grade .title {
+ width: 100%;
+ height: 105rpx;
+}
+
+.Grade .title .column {
+ height: 30rpx;
+ border-left: 6rpx solid rgb(211, 27, 58);
+ margin-right: 12rpx;
+}
+
+.Grade .score-item {
+ height: 55rpx;
+ line-height: 55rpx;
+}
+
+.Grade .score-item .stars {
+ margin-left: 83rpx;
+}
+.Grade .score-item .stars view{
+ width: 60rpx;
+ height: 55rpx;
+}
+
+.Grade .score-item .stars image {
+ width: 35rpx;
+ height: 35rpx;
+}
+.Whether {
+ padding:0rpx 31rpx;
+}
+.Whether .flex-right-vertical {
+ height: 67rpx;
+}
+
+.Whether .flex-right-vertical .radio {
+ margin-right: 15rpx;
+}
+
+.Whether .Submission {
+ margin: 40rpx 0 40rpx 0;
+}
+
+.Whether .white {
+ width: 364rpx;
+ height: 58rpx;
+ background-color: rgb(212, 28, 52);
+ border-radius: 40rpx;
+ line-height: 58rpx;
+}
+.Whether .receive{
+ background-color: rgb(255, 176, 63);
+}
+
+
diff --git a/utils/request.js b/utils/request.js
index 35657e9..4c49293 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -116,7 +116,8 @@ module.exports = {
},
showLoading: function() {
wx.showLoading({
- title: "加载中"
+ title: "加载中",
+ mask:true,
});
},
hideLoading: function() {
@@ -211,6 +212,29 @@ module.exports = {
setTimeout(function () {
if(req) req.abort();
},time*1000)
- }
+ },
+
+ /**
+ * @param {Object} url //url地址
+ * @param {Object} data //data入参
+ * @param {Object} succ //成功的回调
+ * @param {Object} fail //失败的回调
+ */
+ json_post:function(url,data,succ,fail){
+ var th=this;
+ this.showLoading();
+ if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url;
+ var str = JSON.stringify(data);
+ wx.request({
+ url: url,
+ data: str,
+ method: 'POST',
+ header: {
+ 'content-type': 'application/json'
+ },// 设置请求的 header
+ success: function (res) { succ(res);th.hideLoading(); },
+ fail:function(res){fail(res);}
+ })
+ }
};
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
index 5de0a30..d28ccb5 100644
--- a/utils/util.js
+++ b/utils/util.js
@@ -1,4 +1,3 @@
-
function isString(str) {
return (typeof str == 'string') && str.constructor == String;
}
@@ -309,6 +308,11 @@ function draw_randon_rect(ctx,x,y,r,w,h){
}
+
+function null_promise(){
+ var promise=new Promise(function(resolve, reject){ var ob={code:-1,data:null}; resolve(ob); }); return promise;
+}
+
module.exports = {
formatTime: function(e, r) {
var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) {
@@ -400,5 +404,6 @@ module.exports = {
check_mobile: check_mobile,//验证手机
get_rand_item:get_rand_item, //随机获取元素
getDistance:getDistance, //获取俩个经纬网度之间的距离
- draw_randon_rect:draw_randon_rect //画图画圆角矩形
+ draw_randon_rect:draw_randon_rect ,//画图画圆角矩形
+ null_promise:null_promise,//返回空的promise
};