Commit 752fa735 by 谢中龙

优化功能

parent 241bfefe
......@@ -24,7 +24,8 @@
<view class="price">¥{{item.price}}</view>
<view class="pro-num-edit">
<button class="redus-num" data-index="{{index}}" catchtap="minusNum">-</button>
<input class="pro-num-edit-input" type="number" data-index="{{index}}" catchtap bindblur="blurNum" bindinput="inputNum" value="{{item.count}}"></input>
<input class="pro-num-edit-input" disabled type="number"
data-index="{{index}}" catchtap bindblur="blurNum" bindinput="inputNum" value="{{item.count}}"></input>
<button class="add-num" data-index="{{index}}" catchtap="addNum">+</button>
</view>
</view>
......
......@@ -107,7 +107,7 @@ const prod_brand_config = {
appId: 'wx313ec36b710125d4',// 小程序AppID
tunnelToken: 'd6db651f8b9c7db4176465accfc1c913843fd9ad328cd5f4fe201d918072c9e8',//商户默认token
brandId: 3001,//商户ID
plusIsOpen: true, //是否开启plus
plusIsOpen: false, //下单和下单状态界面是否显示购买plus
contactUsIsOpen: true,//是否开启联系我
contactUsPluginId: '766c50920993bf9c41c6c3d2761a2df5',//联系我们插件PluginID
hasTrial: false, // 是否有体验账号
......
......@@ -170,7 +170,7 @@ page{
bottom: 0rpx;
display: flex;
align-items: center;
z-index: 22;
}
.buy-btn{
width: 214rpx;
......
......@@ -220,7 +220,7 @@ wxService.page({
orderPrice: orderInitPrice - calCouponPrice + plusPrice
})
},
//提交按钮
formSubmit(e) {
//判断是不是开卡了
if (this.data.orderingMustOpenCard){
......@@ -450,8 +450,7 @@ wxService.page({
// 获取默认付费会员设置
this.getPremiumDefault()
})
})
});
},
// /premium/getDefault
getPremiumDefault() {
......@@ -484,8 +483,6 @@ wxService.page({
title: '加载中'
});
// params.checkPrice = true;
wxService.post(`/sale/trade/buyer/preview`, params).then(res => {
if (res) {
const { result, data } = res.data
......@@ -542,7 +539,7 @@ wxService.page({
}
})
},
//跳转购买
handelGobuy() {
// 第一项 defalutCouponId couponId/
const {
......@@ -615,13 +612,62 @@ wxService.page({
getBill(params) {
let _this = this;
wx.showLoading({
title: '加载中'
title: '正在下单..'
});
const { isSelect} = this.data;
//增加订单备注信息
params.buyerRemark = this.data.buyerRemark;
//下单之前先做校验
this.checkOrder(params).then(result => {
if (result){
let data = result.data.data ? result.data.data : [];
if(data.length == 0){
this.order(isSelect,params);
}
else{
//有商品限购了,组织提示语
let tips = '根据限购规则以下商品限购:\r\n';
let tempArr = [];
data.forEach(item => {
let txt = '';
//limitType 1 每人限购 2每次限购
if (item.limitType == 1){
if (item.canBuy == 0) {
txt = item.productName
}
else {
txt = item.productName + ',限购数:' + item.canBuy;
}
}
else if (item.limitType == 2){
txt = item.productName + ',限购数:' + item.limitNum;
}
tempArr.push(txt);
});
wx.showModal({
title: '商品限购提醒',
content: tips + tempArr.join('\r\n'),
confirmText : '好的',
confirmColor: '#cb3c3c',
showCancel: false,
success(confirm){
if (confirm.confirm){
wx.navigateBack({
delta : 1
});
}
},
})
}
}
});
},
//下单
order(isSelect,params){
let _this = this;
let url = isSelect ? '/sale/payment/merged/buyer/bill' : '/sale/trade/buyer/bill'
wxService.post(`${url}`, params).then(res => {
if (res) {
......@@ -641,24 +687,25 @@ wxService.page({
},
fail(res) {
wx.hideLoading()
// wxService.router(`/subPackage/page/pages/paymentStatus/paymentStatus?status=F`)
if(_this.data.currentType == 'delivery'){
if (_this.data.currentType == 'delivery') {
wx.redirectTo({
url: '/pages/order/order',
});
}
else{
else {
wx.redirectTo({
url: '/subPackage/page/pages/selfPickUpOrderList/selfPickUpOrderList',
});
}
// wxService.router(`/pages/orderDetail/orderDetail?id=${id}`)
}
}, data.wxParams))
}, data.wxParams));
}
}
})
});
},
//校验订单中商品限购情况
checkOrder(params){
return wxService.post(`/sale/trade/buyer/bill/before/check`,params);
},
// 获取地址列表
getAddressList() {
......@@ -732,8 +779,7 @@ wxService.page({
this.calPreferentialPrice(params)
}
}).finally(() => {
})
}).finally(() => {});
},
//获取微信地址
chooseWxAddress() {
......@@ -794,4 +840,4 @@ wxService.page({
showSelectCoupon: true
})
}
})
\ No newline at end of file
});
\ No newline at end of file
......@@ -403,7 +403,7 @@
"id": 53,
"name": "会员详情",
"pathName": "shoppingGuid/page/pages/userInfo/userInfo",
"query": "id= 677585630707994624",
"query": "id= 640930496804704256",
"scene": null
},
{
......@@ -439,10 +439,11 @@
"query": ""
},
{
"id": 60,
"id": 59,
"name": "任务说明",
"pathName": "shoppingGuid/page/pages/taskNotice/taskNotice",
"query": "id=636202518078164992&type=2"
"query": "id=680451113895464960&type=1",
"scene": null
},
{
"id": 61,
......
// shoppingGuid/page/pages/taskNotice/taskNotice.js
const wxService = require('../../../../utils/wxService')
import { Integer } from '../../../../utils/integerDigitalConvertion'
const app = getApp();
wxService.page({
/**
* 页面的初始数据
*/
data: {
notice : [],
nodata : false,
goods : {
goodsList : []
},
showShareModel: false,
shareModelObj: {
title: '',
imageUrl: '',
path: ''
},
},
/**
......@@ -36,6 +46,14 @@ wxService.page({
this.data.nodata = false;
}
let products = data.task.product ? JSON.parse(data.task.product) : [];
if(products.length > 0){
let proIds = products.map(item => {
return item.id;
});
this.getProductsList(proIds);
}
this.setData({
notice: notice,
nodata: this.data.nodata
......@@ -43,6 +61,137 @@ wxService.page({
}
}
})
},
//跳转到商品详情
onTapToGoodsDetail(e) {
let item = e.currentTarget.dataset.item;
let productId = item.productId;
wx.navigateTo({
url: '/pages/productDetail/productDetail?id=' + productId,
});
},
//根据商品ids获取商品列表
getProductsList(proIds){
wx.showLoading({
title: '获取商品信息中..',
});
wxService.post(`/sale/product/listPage?pageNo=1&pageSize=10000`,{
productIds : proIds
}).then(res => {
if(res){
let list = res.data.data.content ? res.data.data.content : [];
this.data.goods.goodsList = list;
list.forEach(item => {
item.price = parseFloat(item.minSalePrice/10/10).toFixed(2);
item.productImgUrl = item.indexUrl;
});
this.setData({
goods : this.data.goods
});
}
})
},
//定向发送
//定向转发商品给用户 分享功能
onTapToShare(e) {
let item = e.currentTarget.dataset.item;
// 生成触点对象
let content = {
title: item.productName,
id: item.productId,
url: item.productImgUrl
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: item.productId,
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_DETAIL, //内容类型
title: item.productName, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) {
let tentacleId = res.id;
let inner_id = Integer.digit(item.productId, 10, 64);
let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'pages/productDetail/productDetail' + '?i=' + inner_id + '&t=' + inner_tentacleId;
this.data.shareModelObj.title = item.productName;
this.data.shareModelObj.imageUrl = item.productImgUrl;
this.data.shareModelObj.path = path;
this.setData({
shareModelObj: this.data.shareModelObj,
showShareModel: true,
});
}
});
},
//立即群发商品给用户
onTapToRecommandProduct(e) {
let item = e.currentTarget.dataset.item;
// 生成触点对象
let content = {
title: item.productName,
id: item.productId,
url: item.productImgUrl
}
let tentacleInfo = {
content: JSON.stringify(content),
contentId: item.productId,
contentType: app.globalData.contants.SHARE_TYPE.PRODUCT_DETAIL, //内容类型
title: item.productName, //标题
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) {
let tentacleId = res.id;
let inner_id = Integer.digit(item.productId, 10, 64);
let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
var path = 'pages/productDetail/productDetail' + '?i=' + inner_id + '&t=' + inner_tentacleId;
//打开企业微信通讯录选择会员
wx.qy.shareToExternalContact({
appid: app.globalData.appId,//小程序的appid
title: item.productName, //小程序消息的title
imgUrl: item.productImgUrl,//小程序消息的封面图
page: path, //小程序消息打开后的路径
success: function (res) {
wx.showToast({
title: '推荐成功!'
});
},
fail: function (err) {
console.log('error---------------', err);
}
});
}
});
},
//取消分享
onTapCancelShare() {
this.setData({
showShareModel: false,
});
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
if (res.from == 'button') {
return {
title: this.data.shareModelObj.title,
path: this.data.shareModelObj.path,
imageUrl: this.data.shareModelObj.imageUrl
}
}
}
})
\ No newline at end of file
......@@ -4,6 +4,53 @@
<text class='title'>{{item.title}}:</text>
<text class='desc'>{{item.desc}}</text>
</view>
<!-- 未配置 -->
<view class='empty' wx:if="{{nodata}}">暂无活动说明~</view>
</view>
<!-- 商品信息 -->
<view class='main-container'>
<!-- 爆款推荐 -->
<view class="header">参与商品</view>
<view>
<!-- list -->
<view class='goods-list' wx:if="{{goods.goodsList.length > 0}}">
<view class='goods-item'
wx:for="{{goods.goodsList}}"
wx:for-item="item"
wx:for-index="idx"
data-item="{{item}}"
bindtap='onTapToGoodsDetail'
wx:key="{{idx}}">
<image class='goods-lf-icon' src='{{item.indexUrl}}' mode='aspectFit'></image>
<view class='goods-rg-info'>
<view class='goods-title'>{{item.productName}}</view>
<view class='goods-second-title'>{{item.subtitle}}</view>
<view class='goods-price'>
<view class='price'>
<view class='plus'>
<!-- <image src='/assets/imgs/point.png' mode='aspectFit'></image> -->
<text class='original-price'>¥ {{item.price}}</text>
</view>
<!-- <view class='original-price'>¥126.08</view> -->
</view>
<view class='goods-share'>
<view class='send-coupon' data-item="{{item}}" catchtap='onTapToShare'>定向发送</view>
<view class='send-coupon' data-item="{{item}}" catchtap='onTapToRecommandProduct'>群发推荐</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class='empty' wx:if="{{goods.goodsList.length == 0}}">未设置指定任务商品数据~</view>
</view>
<view class='bg' style='display:{{showShareModel ? "block" : "none"}}' bindtap='onTapCancelShare'></view>
<view class='share-container {{showShareModel ? "sliderUp" : ""}}'>
<button open-type="share">
<view class='share-item'>
<image src='/assets/imgs/7_1_0/wx-icon.png' mode='aspectFit'></image>
<text>微信好友</text>
</view>
</button>
</view>
\ No newline at end of file
/* shoppingGuid/page/pages/taskNotice/taskNotice.wxss */
/* shoppingGuid/page/pages/userInfo/userInfo.wxss */
page{
background: #ffffff;
background: #f2f2f2;
box-sizing: border-box;
-webkit-box-sizing: border-box;
font-size: 28rpx;
......@@ -21,6 +21,7 @@ view{
width: 100%;
height: auto;
padding: 30rpx;
background: #ffffff;
}
.active-notice .notice-item{
......@@ -41,4 +42,201 @@ view{
.active-notice .notice-item .desc{
flex: 1;
}
/* 商品信息布局 */
/* 主要布局 */
.main-container{
width: 100%;
height: auto;
padding: 30rpx;
background: #ffffff;
margin-top: 10rpx;
}
.main-container .header{
font-size: 28rpx;
color: #333333;
font-weight: bold;
margin-bottom: 30rpx;
}
.mg-b-40{
margin-bottom: 40rpx;
}
/* 爆款 */
.goods-list{
width: 100%;
height: auto;
}
.goods-list .goods-item{
background: #ffffff;
display: flex;
padding: 20rpx 0;
border-bottom: solid 2rpx #eeeeee;
}
.goods-list .goods-item .goods-lf-icon{
flex: 0;
min-width: 220rpx;
max-width: 220rpx;
height: 220rpx;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
display: flex;
align-items: center;
}
.goods-list .goods-item .goods-rg-info{
flex: 1;
padding: 15rpx 20rpx;
font-size: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.goods-list .goods-item .goods-rg-info .goods-title{
color: #333333;
font-size: 24rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-weight: bold;
margin-bottom: 8rpx;
}
.goods-list .goods-item .goods-rg-info .goods-second-title{
font-size: 22rpx;
color: #999999;
margin-bottom: 20rpx;
}
.goods-list .goods-item .goods-rg-info .goods-price{
display: flex;
align-items: flex-end;
}
.goods-list .goods-item .goods-rg-info .goods-price .price{
flex: 1;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .original-price{
color: #ff3333;
font-weight: bold;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .plus{
display: flex;
align-items: center;
color: #333333;
margin-bottom: 8rpx;
}
.goods-list .goods-item .goods-rg-info .goods-price .price .plus image{
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
}
.goods-list .goods-item .goods-rg-info .goods-share{
flex: 0;
min-width: 220rpx;
max-width: 220rpx;
height: 52rpx;
border: solid 2rpx #ff3333;
border-radius: 26rpx;
display: flex;
font-size: 22rpx;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon{
flex: 0;
min-width: 50%;
max-width: 50%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:first-child{
color: #FA6400;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:first-child:active{
opacity: 0.7;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:last-child:active{
opacity: 0.7;
}
.goods-list .goods-item .goods-rg-info .goods-share .send-coupon:last-child{
color: #ffffff;
background: #ff3333;
border-top-right-radius: 26rpx;
border-bottom-right-radius: 26rpx;
}
/* 分享 */
.bg{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 1000;
display: none;
}
.share-container{
position: fixed;
width: 100%;
height: 200rpx;
background: #ffffff;
bottom: 0;
left: 0;
z-index: 1001;
display: flex;
align-items: center;
justify-content: space-around;
transition: all 0.3s;
transform: translateY(100%);
}
.share-container button{
appearance: none;
background: transparent;
border: none !important;
-webkit-appearance: none;
color:#333333;
}
.share-container button::after { border: none; }
.sliderUp{
transform: translateY(0) !important;
}
.share-container .share-item{
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
.share-container .share-item image{
width: 80rpx;
height: 80rpx;
margin-bottom: 5rpx;
}
\ No newline at end of file
......@@ -34,9 +34,9 @@
binderror=""
bindload=""
/>
现在勾选成为vip,立领200元礼包
现在勾选成为vip,享受更多优惠
</view>
<view class="tips-notice">vip 可尊享9大权益</view>
<view class="tips-notice">vip可尊享更多权益</view>
</view>
<view class="vip-go-to" bindtap="toPlus">去开卡</view>
</view>
......
......@@ -14,7 +14,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.hideShareMenu();
// wx.hideShareMenu();
this.getValueCardList();
},
......
......@@ -20,8 +20,7 @@ wxService.page({
*/
onLoad: function (options) {
this.data.id = options.id;
wx.hideShareMenu();
// wx.hideShareMenu();
this.getValueCardActivityInfo();
},
......@@ -53,7 +52,7 @@ wxService.page({
title: '加载中..',
});
wxService.post(`/merchant/superValueCardActivity/miniProgram/getDetail?id=${this.data.id}`).then(res => {
wxService.post(`/merchant/superValueCardActivity/miniProgram/getDetail?id=${this.data.id}`,{},null,true).then(res => {
if (res) {
let obj = res.data.data ? res.data.data : null;
if (obj) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment