Commit 065dc74b by 谢中龙

修改订单相关

parent d167bd8b
......@@ -91,8 +91,8 @@ App({
const { member } = baseUserInfo
const curMemberTrial = member && member.trial || false
wx.setStorageSync('isExperiencer', curMemberTrial)
if (options.referrerInfo && options.referrerInfo.extraData!=null){
// console.log('调用微信开卡组件回调参数---', options)
if (options.referrerInfo && options.referrerInfo.extraData != null && options.referrerInfo.extraData != undefined){
const { activate_ticket, card_id, code, errCode, wx_activate_after_submit_url } = options.referrerInfo.extraData
let urlData = wx_activate_after_submit_url.split("?");
let url = urlData[0];
......
......@@ -179,6 +179,22 @@ Component({
}
}
if (this.data.skuStock == 0){
wx.showToast({
title: '您所选择的商品规格库存不足,请选择其他规格',
icon : 'none'
})
return ;
}
if (this.data.skuStock < this.data.proNum){
wx.showToast({
title: '您所选择的商品规格库存不足,请选择其他规格',
icon: 'none'
})
return;
}
this.triggerEvent('skuselect', {
skuId: this.data.skuId,
count: this.data.proNum,
......
......@@ -62,7 +62,7 @@ const needMock = '' //
* appId = wxf7bc302c51166dc0 //小程序 appId
* tunnel-token = //token 杨辰提供
* brandId= 2007 //商户Id
* contactUspluginId = 联系我插件id
* contactUspluginId = 64bf88d82b3f0d506bd00ed90d5706f1 联系我插件id
*/
......
......@@ -29,10 +29,13 @@ wxService.page({
this.handleGoActivateCard(this.options)
},
handleGoActivateCard(options={}) {
if(!options) {
console.log('options------------', options)
if (Object.keys(options).length == 0){
this.goUserCenter()
return false
}
options.activate_ticket = decodeURIComponent(options.activate_ticket)
// 解析 url 参数 {}
const parmasSubmitUrl = utils.parseUrl(options.wx_activate_after_submit_url)
......
......@@ -253,7 +253,10 @@ wxService.page({
title: `修改成功`,
icon: 'none'
})
wxService.router(`/pages/myAddress/myAddress`)
wx.navigateBack({
delta : 1
})
}
}).finally(() => {
wx.hideLoading()
......@@ -267,7 +270,9 @@ wxService.page({
title: `保存成功`,
icon: 'none'
})
wxService.router(`/pages/myAddress/myAddress`)
wx.navigateBack({
delta: 1
})
}
}).finally(() => {
wx.hideLoading()
......
......@@ -166,7 +166,11 @@
<text class="cost-label">实付款:</text>
<text class="cost-price">¥{{utils.numberFormat(orderPrice)}}</text>
</view>
<view class="theme-color buy-btn">
<view class="theme-color buy-btn positionRe">
<!-- <button wx:if="{{!currentHasUserInfo}}"
bindgetuserinfo="_getUserInfo"
open-type='getUserInfo'
class='positionAbs' ></button> -->
<button form-type="submit" style="display: inline;" class="theme-color buy-btn">立即购买</button>
</view>
</view>
......
......@@ -15,28 +15,32 @@ wxService.page({
addressList:[],
startX: '',
delBtnWidth: 132,//删除按钮宽度单位(rpx)
isFrom : ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.isFrom = options.isFrom;
wx.hideShareMenu()
},
//处理设为默认按钮
handelCheckShopAddress(e) {
const index = e.currentTarget.dataset.index
const item = this.data.addressList[index]
item.fullArea = item.province + ' ' + item.city + ' ' + item.district
wx.setStorageSync('_defalutAddress', item)
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.setData({
wxAddress: false
})
console.log('beforePage+++++++', beforePage)
setTimeout(() => {
wxService.router().back()
}, 300)
if (this.data.isFrom == 'order'){
const index = e.currentTarget.dataset.index
const item = this.data.addressList[index]
item.fullArea = item.province + ' ' + item.city + ' ' + item.district
wx.setStorageSync('_defalutAddress', item)
let pages = getCurrentPages();
let beforePage = pages[pages.length - 2];
beforePage.setData({
wxAddress: false
});
setTimeout(() => {
wxService.router().back()
}, 300)
}
},
/**
......@@ -64,7 +68,6 @@ wxService.page({
})
},
//获取微信地址
chooseWxAddress() {
wx.chooseAddress({
......@@ -90,7 +93,6 @@ wxService.page({
//设置默认地址
settingDefalutAddress(e){
const { memberId } = wx.getStorageSync('_baseUserInfo')
console.log(e)
let params = {
userId: memberId,
id: e.currentTarget.dataset.id
......
......@@ -154,7 +154,9 @@
report-submit
name='nav'
>
<button disabled="{{productInfo.productStatus != 2}}" class="buy-button get-formId--btn {{productInfo.productStatus != 2 ? 'btn-default' : 'btn-buy'}}" formType="submit">立即购买</button>
<button disabled="{{productInfo.productStatus != 2}}"
class="buy-button get-formId--btn {{productInfo.productStatus != 2 ? 'btn-default' : 'btn-buy'}}"
formType="submit">立即购买</button>
</form>
</block>
......
......@@ -13,6 +13,44 @@ export default class InviteFriends {
posterImgHeight = windowHeight - 200;
}
}
// explain = ['妍希送你很多豪礼的静安寺到就看', '很好三等奖啊可是很好三等奖啊可是','数据库大吉点击奥斯卡数据库大吉点击奥斯卡'];
let textOneBottom = '', textTwoBottom = '' , textThreeBottom = '';
if(explain.length == 1){
textOneBottom = '80rpx';
if (explain[0].length > 11){
explain[0] = explain[0].substr(0,10) + '..';
}
}
else if (explain.length == 2){
textOneBottom = '100rpx';
textTwoBottom = '70rpx';
if (explain[0].length > 11) {
explain[0] = explain[0].substr(0, 9) + '..';
}
if (explain[1].length > 15) {
explain[1] = explain[1].substr(0, 14) + '..';
}
}
else if (explain.length == 3){
textOneBottom = '108rpx';
textTwoBottom = '78rpx';
textThreeBottom = '50rpx';
if (explain[0].length > 11) {
explain[0] = explain[0].substr(0, 9) + '..';
}
if (explain[1].length > 15) {
explain[1] = explain[1].substr(0, 14) + '..';
}
if (explain[2].length > 15) {
explain[2] = explain[2].substr(0, 14) + '..';
}
}
return ({
width: '750rpx',
height: windowHeight - 100 + 'px',
......@@ -30,44 +68,43 @@ export default class InviteFriends {
type: 'image',
url: qrcodeImg,
css: {
width: '100rpx',
height: '100rpx',
width: '140rpx',
height: '140rpx',
right: '28rpx',
bottom: '43rpx',
bottom: '33rpx',
}
},
{
type: 'image',
url: avatarUrl,
css: {
width: '50rpx',
height: '50rpx',
left: '23rpx',
bottom: '43rpx',
borderRadius: '25rpx'
width: '80rpx',
height: '80rpx',
left: '28rpx',
bottom: '53rpx',
borderRadius: '40rpx'
}
},
{
type: 'text',
text: userName + explain[0],
text: userName + explain[0],
css: {
width: '180rpx',
left: '82rpx',
bottom: '83rpx',
fontSize: '18rpx',
color: '#333333'
width: '320rpx',
left: '120rpx',
bottom: textOneBottom,
fontSize: '28rpx',
color: '#000000'
},
},
{
type: 'text',
text: explain[1],
css: {
width: '180rpx',
left: '82rpx',
bottom: '63rpx',
width: '320rpx',
left: '120rpx',
bottom: textTwoBottom,
fontSize: '18rpx',
color: '#333333'
color: '#666666'
},
},
......@@ -75,11 +112,11 @@ export default class InviteFriends {
type: 'text',
text: explain[2],
css: {
width: '180rpx',
left: '82rpx',
bottom: '43rpx',
width: '320rpx',
left: '120rpx',
bottom: textThreeBottom,
fontSize: '18rpx',
color: '#333333'
color: '#666666'
},
},
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": -1,
"current": 32,
"list": [
{
"id": -1,
......@@ -253,8 +253,8 @@
"scene": null
},
{
"id": -1,
"name": "分享",
"id": 32,
"name": "邀请好友编辑海报页面",
"pathName": "subPackage/page/pages/share/share",
"query": "",
"scene": null
......
......@@ -40,7 +40,6 @@ wxService.page({
this.getMiniCode()
this.getShareImg()
wx.hideShareMenu();
},
//轮播图的切换事件
......@@ -105,6 +104,11 @@ wxService.page({
this.setData({
posterImgData: initiatorPage,
explain: explain
},() => {
if (this.data.posterImgData.length > 0){
this.data.currentPosterImg = this.data.posterImgData[0];
this.generatePoster();
}
})
}
}
......@@ -113,12 +117,23 @@ wxService.page({
//获取二维码
getMiniCode() {
this.saveTentacleContent().then(res => {
if(res){
let tentacleId = res.id;
let inner_tentacleId = Integer.digit(tentacleId, 10, 64);
this.getPageQrcode(inner_tentacleId)
}
});
},
//获取界面二维码
getPageQrcode(t){
const urls = utils.getCurrentPageUrlWithArgs()
let _this = this;
let data = {
"autoColor": true,
"page": 'pages/userCenter/userCenter',
"scene": 'type=-1',
"scene": 'type=-1&t=' + t,
"width": 100
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
......@@ -127,39 +142,15 @@ wxService.page({
this.setData({
codeImg: app.globalData.imageUrl + data
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
},()=>{
const { member } = wx.getStorageSync('_baseUserInfo')
const { avatarUrl } = wx.getStorageSync('_userInfo')
wx.getSystemInfo({
success: function (system) {
wx.getImageInfo({
src: _this.data.posterImgData[0],
success: function (res) {
let posterImgWidth = res.width,
posterImgHeight = res.height;
_this.setData({
template: new Card().palette(_this.data.posterImgData[0],
_this.data.codeImg,
member.memberWeixin.nickname,
avatarUrl,
{
posterImgWidth: posterImgWidth,
posterImgHeight: posterImgHeight,
windowWidth: system.windowWidth,
windowHeight: system.windowHeight
}, _this.data.explain),
});
}
})
}
})
}, () => {
_this.generatePoster();
})
}
})
},
// 保存海报
savePoster(){
//生成触点对象信息
saveTentacleContent(){
let tentacleInfo = {
content: "我的邀请页面",
contentType: app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS, //内容类型
......@@ -167,34 +158,47 @@ wxService.page({
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) {
wx.saveImageToPhotosAlbum({
filePath: this.imagePath,
success(res) {
setTimeout(()=>{
wx.showToast({
title: '保存成功,请前往相册查看~',
icon: 'none'
},2000)
})
},
fail(err){
console.log(err)
let txt = '保存失敗';
if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny'){
txt = '获取相册授权失败'
}
setTimeout(() => {
wx.showToast({
title: txt,
icon: 'none'
}, 2000)
})
}
});
return wxService.getTentacleContent(tentacleInfo);
},
// 保存海报
savePoster(){
// let tentacleInfo = {
// content: "我的邀请页面",
// contentType: app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS, //内容类型
// title: '我的邀请', //标题
// type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
// }
// wxService.getTentacleContent(tentacleInfo).then(res => {
// if (res && res.id) {
// }
// })
wx.saveImageToPhotosAlbum({
filePath: this.imagePath,
success(res) {
setTimeout(() => {
wx.showToast({
title: '保存成功,请前往相册查看~',
icon: 'none'
}, 2000)
})
},
fail(err) {
console.log(err)
let txt = '保存失敗';
if (err.errMsg == 'saveImageToPhotosAlbum:fail auth deny') {
txt = '获取相册授权失败'
}
setTimeout(() => {
wx.showToast({
title: txt,
icon: 'none'
}, 2000)
})
}
})
});
},
onImgOK(e) {
this.setData({
......
......@@ -37,18 +37,14 @@
wx:for="{{posterImgData}}"
wx:for-index="idx"
wx:for-item="navItem"
wx:key="idx"
>
wx:key="idx">
<view
class="scroll-view-item {{currentTab == idx ?'poster-active':''}}"
data-current="{{idx}}"
data-img="{{navItem}}"
bindtap="switchPoster"
>
<image class="poster-img" src="{{navItem}}"></image>
<view class="select-plus" wx:if="{{idx == currentTab}}">
bindtap="switchPoster">
<image class="poster-img" src="{{navItem}}" mode='aspectFit'></image>
<view class="select-plus" wx:if="{{idx == currentTab}}">
<view class="circle-radio theme-color">
<image class="tick-success" src="/assets/imgs/7_1_0/tick-success.png" mode="widthFix"></image>
</view>
......
......@@ -39,9 +39,9 @@ swiper-item{
}
.code-img{
position: absolute;
width: 100rpx;
height: 100rpx;
bottom: 43rpx;
width: 120rpx;
height: 120rpx;
bottom: 23rpx;
right: 24rpx;
}
.active{
......@@ -90,23 +90,27 @@ swiper-item{
}
.scroll-view-item {
display: inline-block;
width: 125rpx;
width: 150rpx;
height: 215rpx;
background-color: #d8d8d8;
margin-right: 23rpx;
position: relative;
}
.poster-tips{
position: fixed;
bottom: 220rpx;
left: 33rpx;
}
.poster-tips image{
width: 362rpx;
}
.poster-img{
width: 100%;
height: 215rpx;
/* height: 215rpx; */
max-height: 215rpx;
}
.select-plus{
position: absolute;
......@@ -161,5 +165,7 @@ swiper-item{
height: 100vh;
/* background: #ffffff; */
z-index: -9999;
/* z-index: 999999; */
/* top: 0; */
}
\ No newline at end of file
......@@ -604,7 +604,21 @@ class WXService extends Http {
}
if (item['scene']) {
pageIsFromShare = true;
let idParam = decodeURIComponent(item['scene']).split('&')[0];
let sceneParam = decodeURIComponent(item['scene']);
console.log('sceneParam---', sceneParam)
let tParam = '';
//判断是不是有触点参数
if (sceneParam.indexOf('t=') > -1){
let tArr = sceneParam.split('&');
for (let i = 0; i < tArr.length ; i ++){
if (tArr[i].indexOf('t=') > -1){
tParam = tArr[i].split('t=')[1];
break;
}
}
}
let idParam = sceneParam.split('&')[0];
let shareId = idParam && idParam.split('=')[1] || 0;
// console.log(shareId)
// console.log(idParam)
......@@ -612,10 +626,12 @@ class WXService extends Http {
if (idParam.indexOf('pageId') > -1){
item['pageId'] = shareId;
}
if (tParam){
id = Integer.digit(tParam, 64, 10);
}
//
if (shareId && shareId !=0){
item['id'] = Integer.digit(shareId, 64, 10)
id = item['id'];
item['id'] = Integer.digit(shareId, 64, 10);
}
}
});
......@@ -624,7 +640,6 @@ class WXService extends Http {
//调用接口
_self.getTentacleContentByTentacleId(id);
}
config.onLoad && config.onLoad.apply(page, args);
},
onShow: function (...args) {
......@@ -843,6 +858,7 @@ class WXService extends Http {
}
this.showOpenCardModelLock = true // 避免多次弹出开卡对话窗
// 开卡
console.log('开卡参数为-----', options)
wx.navigateToMiniProgram({
appId: 'wxeb490c6f9b154ef9', // 固定为此 appid,不可改动
extraData: options, // 包括 encrypt_card_id, outer_str, biz三个字段,须从 step3 中获得的链接中获取参数
......@@ -898,11 +914,19 @@ class WXService extends Http {
openCard() {
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
return new Promise((resolve, reject) => {
if (!baseUserInfo){
reject({
state: 0
})
return ;
}
if (baseUserInfo && baseUserInfo.memberActivateStatus) {
// console.log('已开卡', baseUserInfo)
wxService.openCardList()
resolve(baseUserInfo)
} else if (!baseUserInfo || !baseUserInfo.memberActivateStatus) {
}
else if (!baseUserInfo.memberActivateStatus) {
// console.log('去开卡', baseUserInfo)
return this.navigateToMiniProgram({
biz: baseUserInfo.biz,
......
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