Compare commits

...

13 Commits
master ... dev

15 changed files with 895 additions and 633 deletions
Split View
  1. +119
    -2
      .vscode/settings.json
  2. +10
    -19
      ext.json
  3. +2
    -1
      index/index.js
  4. +11
    -11
      index/index.ttml
  5. +29
    -25
      index/user.js
  6. +33
    -24
      index/user.ttml
  7. +258
    -198
      pages/coupon/confirmation/confirmation.js
  8. +1
    -1
      pages/coupon/confirmation/confirmation.json
  9. +1
    -0
      pages/coupon/confirmation/confirmation.ttml
  10. +3
    -2
      pages/coupon/detail/index.ttml
  11. +11
    -11
      pages/getPhone/getPhone.js
  12. +262
    -249
      pages/getuserinfo/getuserinfo.js
  13. +13
    -11
      pages/liveLsit/liveLsit.js
  14. +108
    -78
      pages/order/detail/index.js
  15. +34
    -1
      project.config.json

+ 119
- 2
.vscode/settings.json View File

@@ -1,3 +1,120 @@
{
"bytedanceMiniappIDE.previewScene": "default"
}
"http.proxy": "",
"http.proxySupport": "override",
"proxyType": "system",
"setProxy": "",
"systemProxyUrl": "",
"workbench.colorTheme": "Sublime VSCode Theme",
"workbench.colorThemeType": "dark",
"typescript.tsdk": "E:\\TikTok DevTool\\@bytedminiprogram-ide\\resources\\app\\app.content\\dist\\assets\\business\\typescript\\lib",
"files.associations": {
"*.ttss": "css",
"*.wxss": "css",
"*.sjs": "javascript",
"*.ttml": "ttml",
"*.wxml": "ttml",
"*.sk": "ttml"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.byte-ide": true
},
"emmet.includeLanguages": {
"sjs": "javascript"
},
"security.workspace.trust.untrustedFiles": "open",
"[jsonc]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"explorer.confirmDelete": false,
"less.compile": {
"compress": false,
"out": true,
"outExt": ".ttss"
},
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[json]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"editor.tokenColorCustomizations": {
"keywords": {
"foreground": "#FF0000",
"fontStyle": "italic bold"
},
"variables": {
"foreground": "#ffffff",
"fontStyle": "italic bold",
},
//字符串
"strings": {
"foreground": "#fbff00",
"fontStyle": "italic"
},
//函数
"functions": "#00ffff",
//注释
"comments": "#969696",
"types": "#00ff95"
},
"editor.formatOnSave": true,
"editor.wordWrap": "on",
// 开启原生括号着色
"editor.bracketPairColorization.enabled": true,
// 开启代码块边缘导轨线着色
"editor.guides.bracketPairs": "active",
//覆盖当前所选颜色主题的颜色
"workbench.colorCustomizations": {
//光标颜色
"editorCursor.foreground": "#00ff00",
//编辑器背景色
"editor.background": "#00000025",
//光标所在行边框颜色
//光标所在行背景颜色
"editor.lineHighlightBorder": "#ffffffa1",
"editor.lineHighlightBackground": "#ffffff1e",
//光标选中文本的背景颜色
//光标选中文本时匹配同类型的值的背景颜色
"editor.selectionBackground": "#ff0000c2",
"editor.selectionHighlightBackground": "#00ffff80",
//缩进参考线的颜色
"editorIndentGuide.activeBackground": "#f92672",
//方括号出现意外的前景色
"editorBracketHighlight.unexpectedBracket.foreground": "#ff0000",
//括号的前景色,需要启用括号对着色
"editorBracketHighlight.foreground1": "#ffff00",
"editorBracketPairGuide.activeBackground1": "#ffff00",
"editorBracketHighlight.foreground2": "#f92672",
"editorBracketPairGuide.activeBackground2": "#f92672",
"editorBracketHighlight.foreground3": "#00ffff",
"editorBracketPairGuide.activeBackground3": "#00ffff",
"editorBracketHighlight.foreground4": "#00ff00",
"editorBracketPairGuide.activeBackground4": "#00ff00",
"workbench.colorTheme": "Sublime VSCode Theme",
"[Sublime VSCode Theme]": {
"activityBar.activeBackground": "#ffffff1e",
"activityBar.background": "#292b27",
"activityBar.foreground": "#ffffff",
"activityBar.activeBorder": "#ff0000",
"activityBar.activeFocusBorder": "#ff0000",
"breadcrumb.foreground": "#ffffff",
"breadcrumb.background": "#1a1b18",
"sideBar.background": "#1e1f1c",
"sideBarSectionHeader.background": "#343532",
"sideBarSectionHeader.foreground": "#fff",
"sideBar.border": "#777777",
"sideBar.foreground": "#fff",
"list.hoverBackground": "#8a8a8a",
"list.inactiveSelectionBackground": "#75715e",
"editor.selectionBackground": "#ff0000",
"editorGroupHeader.tabsBackground": "#141415"
},
},
"editor.cursorBlinking": "smooth",
}

+ 10
- 19
ext.json View File

@@ -1,30 +1,21 @@
{
"extEnable": true,
"extAppid": "ttef6599d8705b49b101",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
},
"ttPlugins": {
"dependencies": {
"microapp-trade-plugin": {
"version": "1.1.2",
"isDynamic": true
}
}
},
"ext": {
"weappId": "ttef6599d8705b49b101",
"name": "富茂券模板",
"attr": {
"configUrl": "https://ctest.malls.iformall.com/C/api"
}
},
"name": "富茂券券",
"weappId": "ttef6599d8705b49b101"
},
"window": {
"backgroundTextStyle": "light",
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#fff"
},
"extAppid": "ttef6599d8705b49b101",
"extEnable": true,
"directCommit": false,
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
}
}

+ 2
- 1
index/index.js View File

@@ -1008,7 +1008,8 @@ Page({
url: config.api.bannerlist,
data: {
pageNum: 1,
pageSize: 7
pageSize: 7,
plat:3
}
}).then(res => {
that.getmemberId(app.globalData.token);


+ 11
- 11
index/index.ttml View File

@@ -97,7 +97,7 @@
<c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}"
loading="{{loading}}" />
<!-- 广告蒙层 -->
<c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" />
<!-- <c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" /> -->
</view>
<!-- 顶部签到成长值 -->
<view class='signin' tt:if="{{fistLogin}}" animation="{{alphaData}}">
@@ -171,19 +171,19 @@


<!-- 限时抢购 -->
<c-mould tt:if="{{topicObj2}}" obj="{{topicObj2}}" isShowCount
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_xsqw.png" />
<!-- <c-mould tt:if="{{topicObj2}}" obj="{{topicObj2}}" isShowCount
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_xsqw.png" /> -->
<!-- 砍价 -->
<c-mould tt:if="{{topicObj3}}" obj="{{topicObj3}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_kj.png" />
<!-- <c-mould tt:if="{{topicObj3}}" obj="{{topicObj3}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_kj.png" /> -->
<!-- 拼团 -->
<c-mould tt:if="{{topicObj4}}" obj="{{topicObj4}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_pt.png" />
<!-- <c-mould tt:if="{{topicObj4}}" obj="{{topicObj4}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_pt.png" /> -->
<!-- 专题 -->
<c-mould tt:if="{{specialLsit.length>0}}" tt:for="{{specialLsit}}" tt:key="{{index}}" obj="{{item}}" special />
<!-- <c-mould tt:if="{{specialLsit.length>0}}" tt:for="{{specialLsit}}" tt:key="{{index}}" obj="{{item}}" special /> -->
<!-- 消费卡 -->
<c-mould tt:if="{{topicObj5}}" obj="{{topicObj5}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_xfk.png" />
<!-- <c-mould tt:if="{{topicObj5}}" obj="{{topicObj5}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_xfk.png" /> -->
<!-- 积分商城 -->
<c-mould tt:if="{{topicObj6}}" obj="{{topicObj6}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_jfsc.png" />
@@ -195,7 +195,7 @@
<!-- <c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}" loading="{{loading}}" /> -->

<!-- 广告蒙层 -->
<c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" />
<!-- <c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" /> -->
</view>
<!-- 顶部签到成长值 -->
<view class='signin' tt:if="{{fistLogin}}" animation="{{alphaData}}">


+ 29
- 25
index/user.js View File

@@ -10,7 +10,7 @@ Page({
text: "授权手机号",
avatarUrl: "",
nickName: "",
mouldType:1,
mouldType: 1,
},
showPhoemBtn() {

@@ -23,7 +23,7 @@ Page({
let url = e.currentTarget.dataset.url
console.log(url);
if (url == '/pages/order/index/index?id=all') {
app.globalData.ifshowtab=false
app.globalData.ifshowtab = false
tt.navigateTo({
url: url,
success: (res) => {
@@ -48,7 +48,8 @@ Page({


},
setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功
setPhone(paramData) {
//子组件调用这个方法说明手机号已经授权成功
this.setData({
showPhoem: paramData.detail,
})
@@ -91,29 +92,36 @@ Page({
})
tt.reLaunch({
url: "/index/index",
success(res) {
console.log(`${res}`);
app.globalData.selected = 0
},
fail(err) {
console.log(`navigateTo调用失败`,err);
},
success(res) {
console.log(`${res}`);
app.globalData.selected = 0
},
fail(err) {
console.log(`navigateTo调用失败`, err);
},
});
// tt.showToast({
// title: '取消授权', // 内容
// icon: 'none', // 图标
// success: (res) => {
// },
// fail: (res) => {

// },
// });
},

goSetUserInfo() {
tt.navigateTo({
url: '/pages/getuserinfo/getuserinfo?mineFlag=mine',
});
},

onShow: function (options) {
this.setData({
mouldType:app.globalData.mouldType
mouldType: app.globalData.mouldType
})
this.getmemberId()
Http.get({
@@ -124,33 +132,29 @@ Page({
}).then(res => {
Http.get({
url: config.api.checkPhoneStatus,

}).then(res => {
this.setData({
text:res.data.phone
text: res.data.phone
})
}).catch(err => {
if(app.globalData.ifCongPh==1){
if (app.globalData.ifCongPh == 1) {
tt.navigateTo({
url: '/pages/getPhone/getPhone?mineFlag=mine',
});
}else{
} else {
this.setData({
showPhoem:true
showPhoem: true
})
}
})
}).catch(err => {

if (err.code == 11004) {//未授权抖音
if (err.code == 11004) { //未授权抖音
app.globalData.type = 'uc'
tt.navigateTo({
url: '/pages/getuserinfo/getuserinfo',

url: '/pages/getuserinfo/getuserinfo?mineFlag=mine',
});

}
})
}

+ 33
- 24
index/user.ttml View File

@@ -4,29 +4,36 @@
<navbar tt:if="{{mouldType!=1}}" text="我的" background='#FD832D' color="#fff"></navbar> -->
<!-- <view style="height:{{navigationBarHeight}} "></view> -->
<view class="{{mouldType==1?'userBg1':'userBg'}}">
<view class="userLogo" style="{{mouldType==1?'':'background: linear-gradient(180deg,rgba(253,131,45,1) 0%,rgba(254,74,22,1) 100%);'}}">
<image style="width: 100%;height:100%;border-radius: 50%;" src="{{avatarUrl}}" />
<view class="userLogo"
style="{{mouldType==1?'':'background: linear-gradient(180deg,rgba(253,131,45,1) 0%,rgba(254,74,22,1) 100%);'}}">
<image style="width: 100%;height:100%;border-radius: 50%;" src="{{avatarUrl}}" bindtap="goSetUserInfo" />
<!-- <open-data class="open" type="userAvatarUrl"></open-data> -->
</view>
<view class="userData" style="{{mouldType==1?'#000':'#ffffff'}}">
<view class="noInfo" >{{nickName}}</view>
<view class="noInfo">{{nickName}}</view>
<!-- <open-data class="noInfo" type="userNickName"></open-data> -->
<view class="{{mouldType==1?'infoX':'info'}}" bindtap="showPhoemBtn">{{text}}</view>
<view class="{{mouldType==1?'infoX':'info'}}" bindtap="showPhoemBtn">{{text}}</view>
</view>
</view>
<view class="tempBpx">
<view class="functionBox">

<view class="itemBox" bindtap="go" data-url="/pages/edit/edit">
<view class="itemLogoBox"><image class="itemLogo" src="../assets/images/userInfo.png" /></view>
<view class="itemBox" bindtap="go" data-url="/pages/edit/edit">
<view class="itemLogoBox">
<image class="itemLogo" src="../assets/images/userInfo.png" />
</view>
<view class="itemNAme">个人信息</view>
</view>
<view class="itemBox" bindtap="go" data-url="/pages/order/index/index?id=all">
<view class="itemLogoBox"><image class="itemLogo" src="../assets/images/userDd.png" /></view>
<view class="itemLogoBox">
<image class="itemLogo" src="../assets/images/userDd.png" />
</view>
<view class="itemNAme">我的订单</view>
</view>
<view class="itemBox" bindtap="go" data-url="/pages/couponorder/index/index">
<view class="itemLogoBox"><image class="itemLogo" src="../assets/images/userQuan.png" /></view>
<view class="itemLogoBox">
<image class="itemLogo" src="../assets/images/userQuan.png" />
</view>
<view class="itemNAme">我的券包</view>
</view>
<!-- <view class="itemBox" bindtap="go" data-url="/pages/integralmall/index">
@@ -35,9 +42,9 @@
</view> -->
</view>
</view>
<view class="moreBox">
<view class="fuwu">更多服务</view>
<view class="fuwu">更多服务</view>
<view class="fuwuItemBox">
<!-- <view class="fuwuItem">
<navigator class="fuwuLogoBox" url="/pages/complaint/complaint" hover-class="navigator-hover" open-type="navigate">
@@ -45,36 +52,38 @@
</navigator>
<view class="fuwuName">投诉建议</view>
</view> -->
<navigator class="fuwuItem" url="/pages/questionnaire/questionnaireLsit/questionnaireLsit" hover-class="navigator-hover" open-type="navigate">
<!-- <navigator class="fuwuItem" url="/pages/questionnaire/questionnaireLsit/questionnaireLsit" hover-class="navigator-hover" open-type="navigate">
<view class="fuwuLogoBox f" >
<image class="itemLogo" src="../assets/images/wenquan.png" />
</view>
<view class="fuwuName f">问卷调查</view>
</navigator>
<navigator class="fuwuItem" url="/pages/mallInfo/mallInfo" hover-class="navigator-hover" open-type="navigate">
<view class="fuwuLogoBox f" >
<image class="itemLogo" src="../assets/images/mian1.png" />
</navigator> -->
<navigator class="fuwuItem" url="/pages/mallInfo/mallInfo" hover-class="navigator-hover"
open-type="navigate">
<view class="fuwuLogoBox f">
<image class="itemLogo" src="../assets/images/mian1.png" />
</view>
<view class="fuwuName f">关于我们</view>
</navigator>

<button class="fuwuItem" open-type="contact">
<view class="fuwuLogoBox f" >
<image class="itemLogo" src="../assets/images/service1.png" />
<view class="fuwuLogoBox f">
<image class="itemLogo" src="../assets/images/service1.png" />
</view>
<view class="fuwuName f">在线客服</view>
</button>

<navigator class="fuwuItem" url="/pages/certification/certification" hover-class="navigator-hover" open-type="navigate">
<view class="fuwuLogoBox f" >
<image class="itemLogo" src="../assets/images/aptitude1.png" />
<navigator class="fuwuItem" url="/pages/certification/certification" hover-class="navigator-hover"
open-type="navigate">
<view class="fuwuLogoBox f">
<image class="itemLogo" src="../assets/images/aptitude1.png" />
</view>
<view class="fuwuName f">服务资质</view>
</navigator>
</view>
</view>
<phoem showBox="{{showPhoem}}" bind:hiePhoen="setPhone" bind:heiBox="setBox"></phoem>
</view>
<tabbar/>
</view>
<tabbar />

+ 258
- 198
pages/coupon/confirmation/confirmation.js View File

@@ -7,6 +7,7 @@ const imgurl = require("../../../utils/imgurl");
Page({
data: {
couponIds: "",
showPhoem: false,
couponChannelId: "",
showPage: false,
data: {},
@@ -53,7 +54,9 @@ Page({
getSupId(id) {
Http.get({
url: config.api.getSpuid,
data: { id: id }
data: {
id: id
}
}).then(res => {
if (res.data) {
this.setData({
@@ -70,7 +73,50 @@ Page({
})
},

getCouponPriceAndStock(couponChannelId) {//获取券价格与库存
setPhone(paramData) {
//子组件调用这个方法说明手机号已经授权成功
this.setData({
showPhoem: paramData.detail,
})
tt.showToast({
title: '授权成功', // 内容
icon: 'none', // 图标
success: (res) => {

},
fail: (res) => {

},
});
},

setBox(paramData) {
this.setData({
showPhoem: paramData.detail
})
tt.showToast({
title: '取消授权', // 内容
icon: 'none', // 图标
success: (res) => {
tt.reLaunch({
url: "/index/index",
success(res) {
console.log(`${res}`);
app.globalData.selected = 0
},
fail(err) {
console.log(`navigateTo调用失败`, err);
},
});

},
fail: (res) => {

},
});
},

getCouponPriceAndStock(couponChannelId) { //获取券价格与库存
Http.get({
url: config.api.couponPriceAndStock,
data: {
@@ -88,7 +134,7 @@ Page({
let that = this;
let data = {};

that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存
that.getCouponPriceAndStock(couponChannelId); //获取券价格和库存
if (that.data.couponIds) {
data.couponId = couponChannelId
} else {
@@ -241,20 +287,20 @@ Page({
})
},
/**
* 支付订单更新
*/
* 支付订单更新
*/
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this, composeOrderType) => {
let that = this;
// 支付成功
Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
.then(res => {
tt.hideLoading()
// 有价券
@@ -324,7 +370,7 @@ Page({
success: function (res1) {
if (res1.confirm) {

if (that.data.composeOrderType > 0) {//券包
if (that.data.composeOrderType > 0) { //券包
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}`,
})
@@ -373,141 +419,153 @@ Page({
}).then(res => {
//
// if (!tt.canIUse('createOrder') || that.data.data.type == 50 || that.data.priceAndStockObj.salePrice == 0) {
//积分券和免费券
// 发起砍价
if (discount == 'discount') {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
press: true
}
} else if (discount == 'discount1') {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
press: false
}
} else if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
};
} else {
var data = {
//积分券和免费券
// 发起砍价
if (discount == 'discount') {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
press: true
}
} else if (discount == 'discount1') {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
press: false
}
} else if (that.data.couponChannelId == null) {
var data = {
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
};
} else {
var data = {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
}
}
console.log(data, "data")
let url = ""
let tempObj;
let tempArr = []
if (that.data.data.type == 12) {
url = config.api.couponPackageSave
tempObj = {
signleOrder: {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
}
},
count: "1"
}
console.log(data, "data")
let url = ""
let tempObj;
let tempArr = []
if (that.data.data.type == 12) {
url = config.api.couponPackageSave
tempObj = {
signleOrder: {
couponChannelId: "" + that.data.couponChannelId,
couponId: "" + that.data.couponId,
formId: "" + that.data.formId,
},
count: "1"
}
tempArr.push(tempObj)
} else {
url = config.api.orderSave
}
/**
* orderSave 下单
*/
Http.post({
url: url,
data: that.data.data.type == 12 ? JSON.stringify(tempArr) : data
}).then(res => {
if (discount != 'discount') {
if (typeof (res) != "undefined") {
let orderId = "" + res.data.mainOrderId;
that.setData({
orderId: orderId,
composeOrderType: res.data.composeOrderType
});
if (res.data.payment > 0) {
// 支付金额不为0
if (tt.canIUse('createOrder')) {
Http.post({
url: config.api.payOrderCreate_2,
data: {
orderId: orderId,
composeOrderType: res.data.composeOrderType
}
}).then(res => {
console.log(res,"789789");
let tempCallbackData = {
composeOrderId:res.data.outOrderNo
}
// tempCallbackData[that.data.data.couponChannel.ttSpuId] = that.data.data.couponChannel.id
let options = {
callbackData: tempCallbackData,
goodsList: res.data.goodsList,
payment: res.data.payment,
success: res => {
tempArr.push(tempObj)
} else {
url = config.api.orderSave
}
/**
* orderSave 下单
*/
Http.post({
url: url,
data: that.data.data.type == 12 ? JSON.stringify(tempArr) : data
}).then(res => {
if (discount != 'discount') {
if (typeof (res) != "undefined") {
let orderId = "" + res.data.mainOrderId;
that.setData({
orderId: orderId,
composeOrderType: res.data.composeOrderType
});
if (res.data.payment > 0) {
// 支付金额不为0
if (tt.canIUse('createOrder')) {
Http.post({
url: config.api.payOrderCreate_2,
data: {
orderId: orderId,
composeOrderType: res.data.composeOrderType
}
}).then(res => {
console.log(res, "789789");
let tempCallbackData = {
composeOrderId: res.data.outOrderNo
}
// tempCallbackData[that.data.data.couponChannel.ttSpuId] = that.data.data.couponChannel.id
let options = {
callbackData: tempCallbackData,
goodsList: res.data.goodsList,
payment: res.data.payment,
success: res => {
tt.hideLoading();
that.setData({
showbutton: false,
})
const {
orderId,
outOrderNo
} = res;
that.setData({
orderId,
outOrderNo
});
that.payOrderUpdate(outOrderNo, outOrderNo, 1, '', '', that, '');
},
fail: res => {
const {
orderId,
outOrderNo,
errNo,
errMsg,
errLogId
} = res;
if (errLogId) {
tt.hideLoading();
that.setData({
showbutton: false,
})
const { orderId, outOrderNo } = res;
that.setData({ orderId, outOrderNo });
that.payOrderUpdate(outOrderNo, outOrderNo, 1, '', '', that, '');
},
fail: res => {
const { orderId, outOrderNo, errNo, errMsg, errLogId } = res;
if (errLogId) {
tt.hideLoading();
that.setData({
showbutton: false,
})
console.log('预下单失败', errNo, errMsg, errLogId);
let tempErrmsg = errMsg.split('开发者拒绝交易:');
tt.showToast({
title: tempErrmsg[tempErrmsg.length - 1],
icon: 'none',
duration: 2000,
mask: false
});
}
if (orderId || outOrderNo) {
tt.hideLoading();
that.setData({
showbutton: false,
})
console.log('支付失败', errNo, errMsg, orderId, outOrderNo);
console.log(that.payOrderUpdate, "payOrderUpdate");
tt.showToast({
title: "取消支付",
icon: 'none',
duration: 2000,
mask: false
});
that.payOrderUpdate(outOrderNo, outOrderNo, 2, '', 'fail')
}
},
}
console.log(options, "options");
tt.createOrder(options)
})

} else {//不支持2.0支付
/**
console.log('预下单失败', errNo, errMsg, errLogId);
let tempErrmsg = errMsg.split('开发者拒绝交易:');
tt.showToast({
title: tempErrmsg[tempErrmsg.length - 1],
icon: 'none',
duration: 2000,
mask: false
});
}
if (orderId || outOrderNo) {
tt.hideLoading();
that.setData({
showbutton: false,
})
console.log('支付失败', errNo, errMsg, orderId, outOrderNo);
console.log(that.payOrderUpdate, "payOrderUpdate");
tt.showToast({
title: "取消支付",
icon: 'none',
duration: 2000,
mask: false
});
that.payOrderUpdate(outOrderNo, outOrderNo, 2, '', 'fail')
}
},
}
console.log(options, "options");
tt.createOrder(options)
})

} else { //不支持2.0支付
/**
* 支付订单创建
*/
tt.showToast({
title: '请升级抖音', // 内容
icon: "none"
});
return
Http.post({
tt.showToast({
title: '请升级抖音', // 内容
icon: "none"
});
return
Http.post({
url: config.api.payOrderCreate,
data: {
orderId: orderId,
@@ -544,8 +602,7 @@ Page({
})
}
}
}
else if (res.code === 1) {
} else if (res.code === 1) {
that.setData({
showbutton: false
})
@@ -605,66 +662,66 @@ Page({
})
return;
},
complete: res => { }
complete: res => {}
});
/// End payment --------
})
.catch(err => {
tt.hideLoading();
tt.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
}

} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free', that, that.data.composeOrderType);
if (that.data.cardType == 100) {
tt.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else if (that.data.data.type != "5" && that.data.cardType != 100) {
tt.setStorage({
key: 'couponNum',
data: "couponNum"
.catch(err => {
tt.hideLoading();
tt.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
}
}
}
} else {
if (res) {
tt.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.mainOrderId}&composeOrderType=${res.data.composeOrderType}`,
})

} else {
// 免费券
that.payOrderUpdate(orderId, "0", 1, '', 'free', that, that.data.composeOrderType);
if (that.data.cardType == 100) {
tt.setStorage({
key: 'couponNum2',
data: "couponNum2"
})
} else if (that.data.data.type != "5" && that.data.cardType != 100) {
tt.setStorage({
key: 'couponNum',
data: "couponNum"
})
}
}
}
}).catch(err => {
tt.hideLoading();
that.setData({
showbutton: false,
})
if (err.code == 3012) {
that.getUnPaidOrder(that.data.couponId);
} else {
tt.showToast({
title: err.message ? err.message : err.data,
icon: 'none',
duration: 2000,
success(res) {
console.log(res);
},
fail(res) {
console.log("showToast 调用失败", res);
},
});
} else {
if (res) {
tt.navigateTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${res.data.mainOrderId}&composeOrderType=${res.data.composeOrderType}`,
})
}

}
}).catch(err => {
tt.hideLoading();
that.setData({
showbutton: false,
})
if (err.code == 3012) {
that.getUnPaidOrder(that.data.couponId);
} else {
tt.showToast({
title: err.message ? err.message : err.data,
icon: 'none',
duration: 2000,
success(res) {
console.log(res);
},
fail(res) {
console.log("showToast 调用失败", res);
},
});
}

})
// } else {
// //有价券
// console.log(tt.canIUse('createOrder'), "是否支持2.0js-api");
@@ -809,9 +866,15 @@ Page({
* 将值传到用户手机号授权的页面
*
*/
tt.navigateTo({
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&path=qr`
});
if (app.globalData.ifCongPh == 1) {
tt.navigateTo({
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&path=qr`,
});
} else {
this.setData({
showPhoem: true
})
}
} else if (err.code == 11006) {
// 用户手机已加密
tt.navigateTo({
@@ -837,7 +900,6 @@ Page({
url: `/pages/getuserinfo/getuserinfo?fromflag=confirmation&confirmationFlag=${that.data.couponChannelId}`,
})
} else {

tt.showToast({
title: err.message,
icon: "none",
@@ -846,6 +908,4 @@ Page({
}
})
},


})

+ 1
- 1
pages/coupon/confirmation/confirmation.json View File

@@ -3,7 +3,7 @@
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"c-coupons": "../../../components/coupons/index",
"phoen":"../../../components/getPhoen/getPhoen"
"phoem":"../../../components/getPhoen/getPhoen"
},
"navigationBarTitleText": "确认订单",
"backgroundColor":"#f4f4f4",


+ 1
- 0
pages/coupon/confirmation/confirmation.ttml View File

@@ -16,6 +16,7 @@
<view class="price">{{data.type==50?priceAndStockObj.creditPrice+'积分':priceAndStockObj.salePrice/100}}</view>
<view class="buyX" bindtap="orderFunc">{{data.type==50?'立即换购':'提交订单'}}</view>
</view>
<phoem showBox="{{showPhoem}}" bind:hiePhoen="setPhone" bind:heiBox="setBox"></phoem>
</view>
<view class="go" bindtap="goInstructions">
<view class="goTitle">使用须知</view>


+ 3
- 2
pages/coupon/detail/index.ttml View File

@@ -107,6 +107,7 @@
<view class="childMoney">¥{{item.priceStr}}</view>
</view>
</view>
<vieW class="groupTitleBox">
<view class="groupTitle" tt:if="{{data.itemGroup.length>0}}">餐饮搭配</view>
<view class="groupTitle" tt:if="{{data.Description.length>0}}">商品描述</view>
@@ -344,11 +345,11 @@
</view>
</view>
</view>
<view class="shootBox" tt:if="{{spuIdObj.lastStatus==4}}">
<!-- <view class="shootBox" tt:if="{{spuIdObj.lastStatus==4}}">
<button class="mount" open-type="share" data-channel="video">
<image src="../../../assets/images/shoot.png" class="videoCla"/>
<view class="issue">发布视频</view>
</button>
</view>
</view> -->
<phoen showBox="{{showBox}}" bind:hiePhoen="setPhone" bind:heiBox="setBox" />
</view>

+ 11
- 11
pages/getPhone/getPhone.js View File

@@ -16,7 +16,7 @@ Page({
couponId: "",
// skip: app.globalData.skip
},
onLoad: function(options) {
onLoad: function (options) {

var that = this;
console.log(options.skipUrl, "options.skipUrl")
@@ -44,7 +44,7 @@ Page({
});
}

if (options && options.mineFlag) {
if (options && options.mineFlag) {
that.setData({
mineFlag: options.mineFlag
})
@@ -77,7 +77,7 @@ Page({
});
})
},
onShow: function() {
onShow: function () {
tt.checkSession({
success() {
//session_key 未过期,并且在本生命周期一直有效
@@ -105,15 +105,15 @@ Page({
}
})
},
backHome(){
backHome() {
console.log("我调用的返回");
tt.navigateBack({
delta: 1,
success: (res) => {
},
fail: (res) => {
},
});

@@ -122,11 +122,11 @@ Page({
// success: (res) => {
// },
// fail: (res) => {
// },
// });
},
getPhoneNumber: function(e) {
getPhoneNumber: function (e) {
var that = this;
var iv = e.detail.iv;
var encryptedData = e.detail.encryptedData;
@@ -137,7 +137,7 @@ Page({
iv: iv
}
}).then(res => {
app.globalData.phone = res.data.phone;
if (that.data.skipUrl == '1') {
console.log(app.globalData.skip, app.globalData.skipUrl, "跳转地址")
@@ -161,7 +161,7 @@ Page({
url: app.globalData.skipUrl,
})
return;
}else if (app.globalData.skip == 'navigateBack') {
} else if (app.globalData.skip == 'navigateBack') {
tt.navigateBack({
delta: 1,
})
@@ -251,7 +251,7 @@ Page({
tt.showToast({
title: res.data.msg,
icon: "success",
success: function(res) {
success: function (res) {
if (that.data.couponChannelId) {
tt.redirectTo({
url: "/pages/coupon/detail/index?couponChannelId=" + that.data.couponChannelId + "&flag=pay"


+ 262
- 249
pages/getuserinfo/getuserinfo.js View File

@@ -13,13 +13,13 @@ Page({
optionData: null,
fromflag: '',
couponChannelIdflag: '',
confirmationFlag:'',
confirmationFlag: '',
wjId: "",
composeOrderType: "",
fillIndentId: "",
url: null,//游戏路径
id: null,//游戏id,
gameId: null,//游戏gameId
url: null, //游戏路径
id: null, //游戏id,
gameId: null, //游戏gameId
},

backHome() {
@@ -32,10 +32,10 @@ Page({
tt.reLaunch({
url: "/index/index",
success: (res) => {
},
fail: (res) => {
},
});
},
@@ -75,29 +75,29 @@ Page({
}

}).catch(err => {
if(app.globalData.ifCongPh==1){
if (app.globalData.ifCongPh == 1) {
tt.redirectTo({
url: `/pages/getPhone/getPhone?skipUrl=1`
});
}else{
} else {
tt.navigateBack({
delta: 1,
})
}
})
},
onLoad: function (options) {
console.log(app.globalData.skip, app.globalData.skipUrl, app.globalData.type, "跳转地址")
var that = this;
// options.fromflag == 'coupondetail';
// 游戏页面
if (options && options.url && options.id && options.gameId) {
that.setData({
url: options.url,//游戏路径
id: options.id,//游戏id,
gameId: options.gameId,//游戏gameId
url: options.url, //游戏路径
id: options.id, //游戏id,
gameId: options.gameId, //游戏gameId
})
}
// 来自优惠券详情页面
@@ -136,6 +136,12 @@ Page({
wjId: options.wjId
})
}
// 我的
if (options && options.mineFlag) {
that.setData({
mineFlag: options.mineFlag
})
}
if (options && options.spellGroup) {
that.setData({
spellGroup: options.spellGroup
@@ -184,18 +190,18 @@ Page({
})
}
Http.get({
url: config.api.marketicon,
data: {
appId: app.globalData.appId
}
}).then(res => {
that.setData({
mallImgUrl: res.data.mallImgUrl
});
tt.setNavigationBarTitle({
title: res.data.mallName
url: config.api.marketicon,
data: {
appId: app.globalData.appId
}
}).then(res => {
that.setData({
mallImgUrl: res.data.mallImgUrl
});
tt.setNavigationBarTitle({
title: res.data.mallName
})
})
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -246,241 +252,248 @@ Page({
// console.log(res,"数据");
// return
tt.login({
success:(res=>{
let {code} = res
console.log(code,"code");
success: (res => {
let {
code
} = res
console.log(code, "code");
Http.post({
url:config.api.login,
data:{
code:code,
appId:app.globalData.appId,
systemInfo:JSON.stringify(app.globalData.systemInfo)
url: config.api.login,
data: {
code: code,
appId: app.globalData.appId,
systemInfo: JSON.stringify(app.globalData.systemInfo)
}
}).then(res=>{
}).then(res => {
Http.setToken(res.data.token);
app.globalData.token = res.data.token
Http.post({
url: config.api.getUserInfo,
data: {
encryptedData: encryptedData,
iv: iv
}
}).then(res => {
if (app.globalData.type == 'gm' && that.data.id && that.data.gameId && that.data.url) {//游戏页面
app.globalData.skipUrl = '/pages/game/index?url=' + that.data.url + "&id=" + that.data.id + "&gameId=" + that.data.gameId,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
return;
}
if (that.data.wjId) {
app.globalData.skipUrl = `/pages/questionnaire/questionnaire?id=${that.data.wjId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
return;
}
if (that.data.fromflag == 'poster') {
app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
return;
}
//
if (that.data.optionData != null && that.data.optionData.orderGroupId != null && that.data.optionData.orderGroupId != "") {
app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}`
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
return;
}
if (that.data.path == 'index') {
app.globalData.skipUrl = "/pages/game/index"
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
} else {
//返回主页
// if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') {
if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') {
// 跳转普通券/消费卡/限时秒杀/砍价详情
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}`
app.globalData.skip = 'navigateTo'
that.judgePhonelngo()
} else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') {
// 来自转赠
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}`
app.globalData.skip = 'reLaunch'
url: config.api.getUserInfo,
data: {
encryptedData: encryptedData,
iv: iv
}
}).then(res => {
if (app.globalData.type == 'gm' && that.data.id && that.data.gameId && that.data.url) { //游戏页面
app.globalData.skipUrl = '/pages/game/index?url=' + that.data.url + "&id=" + that.data.id + "&gameId=" + that.data.gameId,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) {
// 拼团详情页
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`
return;
}
if (that.data.wjId) {
app.globalData.skipUrl = `/pages/questionnaire/questionnaire?id=${that.data.wjId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'gm') {
// 游戏页面
that.getGameOne(app.globalData.token, that.data.optionData.id)
} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'td') {
app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}`
return;
}
if (that.data.mineFlag) {
app.globalData.skipUrl = `/index/user`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
return;
}
// 报名活动
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'ra') {
app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
if (that.data.fromflag == 'poster') {
app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
return;
}
// 报名签到
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'si') {
app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
//

if (that.data.optionData != null && that.data.optionData.orderGroupId != null && that.data.optionData.orderGroupId != "") {
app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}`
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
return;
}
// 门店详情
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'md') {
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
if (that.data.path == 'index') {
app.globalData.skipUrl = "/pages/game/index"
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
}
// 通过分享进入的门店详情页面
else if (that.data.id && that.data.frommd == 'md') {
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`,
} else {
//返回主页
// if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') {
if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') {
// 跳转普通券/消费卡/限时秒杀/砍价详情
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}`
app.globalData.skip = 'navigateTo'
that.judgePhonelngo()
} else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') {
// 来自转赠
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}`
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
} else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) {
// 拼团详情页
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.optionData != null && that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') {
// 宣传页详情
if (that.data.optionData != null && that.data.optionData.bt == '2') {
// 自由图文
app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`,
that.judgePhonelngo()
} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'gm') {
// 游戏页面
that.getGameOne(app.globalData.token, that.data.optionData.id)

} else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'td') {
app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
// 报名活动
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'ra') {
app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else {
// 标准格式
app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`,
}
// 报名签到
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'si') {
app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
} else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') {
// 参与砍价
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&composeOrderType=${that.composeOrderType}`,
app.globalData.skip = 'navigateTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'uc') {
// 我的
app.globalData.skipUrl = '/index/user',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'in') {
// 首页
app.globalData.skipUrl = app.globalData.goHomeUrl,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == "qd") {
//每日签到
app.globalData.skipUrl = "/pages/activityCalendar/activityCalendar"
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
} else if (app.globalData.type == "hdrl") {
//活动日历
app.globalData.skipUrl = `/pages/radetail/index?id=${app.globalData.activityId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
// 积分
else if (app.globalData.type == 'jf') {
app.globalData.skipUrl = '/pages/integralmall/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'pc') {
// 停车
app.globalData.skipUrl = '/index/passCar',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mc') {
// 我的券包
app.globalData.skipUrl = '/pages/couponorder/index/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mo') {
// 我的订单
app.globalData.skipUrl = '/pages/order/index/index?id=all',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ca') {
// 我的卡包
app.globalData.skipUrl = '/pages/cardorder/index/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'sc') {
// 特享礼遇
app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'rb') {
// 限时秒杀
app.globalData.skipUrl = '/pages/rushToBuy/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'bl') {
// 砍价专场
app.globalData.skipUrl = '/pages/bargain/bargain',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mb') {
// 我的砍价
app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'sl') {
// 拼团专场
app.globalData.skipUrl = '/pages/spellGroup/spellGroup',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ms') {
// 我的拼团
app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'dc') {
// 消费卡
app.globalData.skipUrl = '/pages/discountCardList/discountCardList',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'td') {
// 专题活动页
app.globalData.skipUrl = '/pages/topicDetail/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ml') {
// 门店
app.globalData.skipUrl = '/index/searchbar',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'confirmation' && that.data.confirmationFlag) {
//订单确认 confirmation
app.globalData.skipUrl = `/pages/coupon/confirmation/confirmation?couponChannelId=${that.data.confirmationFlag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) {
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) {
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'fillIndent' && that.data.fillIndentId && that.data.couponId) {
//线上配送 填写订单
app.globalData.skipUrl = `/pages/fillIndent/fillIndent?id=${that.data.fillIndentId}&couponId=${that.data.couponId}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else {
app.globalData.skipUrl = app.globalData.goHomeUrl,
// 门店详情
else if (that.data.optionData != null && that.data.optionData.id && app.globalData.type == 'md') {
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
// 通过分享进入的门店详情页面
else if (that.data.id && that.data.frommd == 'md') {
app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.optionData != null && that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') {
// 宣传页详情
if (that.data.optionData != null && that.data.optionData.bt == '2') {
// 自由图文
app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else {
// 标准格式
app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
} else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') {
// 参与砍价
app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}&composeOrderType=${that.composeOrderType}`,
app.globalData.skip = 'navigateTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'uc') {
// 我的
app.globalData.skipUrl = '/index/user',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'in') {
// 首页
app.globalData.skipUrl = app.globalData.goHomeUrl,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == "qd") {
//每日签到
app.globalData.skipUrl = "/pages/activityCalendar/activityCalendar"
app.globalData.skip = 'reLaunch'
that.judgePhonelngo()
} else if (app.globalData.type == "hdrl") {
//活动日历
app.globalData.skipUrl = `/pages/radetail/index?id=${app.globalData.activityId}`
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
that.judgePhonelngo()
}
// 积分
else if (app.globalData.type == 'jf') {
app.globalData.skipUrl = '/pages/integralmall/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'pc') {
// 停车
app.globalData.skipUrl = '/index/passCar',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mc') {
// 我的券包
app.globalData.skipUrl = '/pages/couponorder/index/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mo') {
// 我的订单
app.globalData.skipUrl = '/pages/order/index/index?id=all',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ca') {
// 我的卡包
app.globalData.skipUrl = '/pages/cardorder/index/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'sc') {
// 特享礼遇
app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'rb') {
// 限时秒杀
app.globalData.skipUrl = '/pages/rushToBuy/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'bl') {
// 砍价专场
app.globalData.skipUrl = '/pages/bargain/bargain',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'mb') {
// 我的砍价
app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'sl') {
// 拼团专场
app.globalData.skipUrl = '/pages/spellGroup/spellGroup',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ms') {
// 我的拼团
app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'dc') {
// 消费卡
app.globalData.skipUrl = '/pages/discountCardList/discountCardList',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'td') {
// 专题活动页
app.globalData.skipUrl = '/pages/topicDetail/index',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (app.globalData.type == 'ml') {
// 门店
app.globalData.skipUrl = '/index/searchbar',
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'confirmation' && that.data.confirmationFlag) {
//订单确认 confirmation
app.globalData.skipUrl = `/pages/coupon/confirmation/confirmation?couponChannelId=${that.data.confirmationFlag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) {
app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) {
app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else if (that.data.fromflag == 'fillIndent' && that.data.fillIndentId && that.data.couponId) {
//线上配送 填写订单
app.globalData.skipUrl = `/pages/fillIndent/fillIndent?id=${that.data.fillIndentId}&couponId=${that.data.couponId}`,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
} else {
app.globalData.skipUrl = app.globalData.goHomeUrl,
app.globalData.skip = 'redirectTo'
that.judgePhonelngo()
}
}
}
})
})
.catch(err => {
tt.showToast({
title: err.code,
@@ -489,8 +502,8 @@ Page({
mask: false
});
})
}).catch(err=>{
}).catch(err => {
console.log(err);
tt.showModal({
title: '提示',
@@ -508,11 +521,11 @@ Page({
}
});
})
}),
});


},
@@ -524,16 +537,16 @@ Page({
getGameOne: function (token, id) {
let _this = this;
Http.get({
url: config.api.getOneGame,
data: {
token: token,
id: id
}
}).then(res => {
tt.redirectTo({
url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId,
url: config.api.getOneGame,
data: {
token: token,
id: id
}
}).then(res => {
tt.redirectTo({
url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId,
})
})
})
.catch(err => {
tt.showModal({
title: '提示',


+ 13
- 11
pages/liveLsit/liveLsit.js View File

@@ -3,7 +3,9 @@ const util = require("../../utils/util.js");
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
const imgurl = require("../../utils/imgurl");
const { alipay } = require("../../utils/imgurl");
const {
alipay
} = require("../../utils/imgurl");
let app = getApp();
Page({
data: {
@@ -12,16 +14,16 @@ Page({
noDataFlag: false,
businePageNum: 1,
businessData: null,
Lsit:[],
Lsit: [],
},
goOrder(){
goOrder() {
tt.navigateTo({
url: '/pages/order/index/index',
success: (res) => {
},
fail: (res) => {
},
});
},
@@ -60,8 +62,8 @@ Page({
let data = res.data.list
data.map(item => {
tempArr.push(item.id)
item.discount = (((item.salePriceStr*1)/(item.priceStr*1))*10).toFixed(1)
item.discount = (((item.salePriceStr * 1) / (item.priceStr * 1)) * 10).toFixed(1)
})
if (this.data.businePageNum > 1) {
this.setData({
@@ -122,7 +124,7 @@ Page({
let data = res.data.list
data.map(item => {
tempArr.push(item.id)
item.discount = (((item.salePriceStr*1)/(item.priceStr*1))*10).toFixed(1)
item.discount = (((item.salePriceStr * 1) / (item.priceStr * 1)) * 10).toFixed(1)
})
if (this.data.businePageNum > 1) {
this.setData({
@@ -168,7 +170,6 @@ Page({

//获取券列表的价格和库存(列表接口有缓存通过这个来获取) str 列表数组里面的所有id
getPriceAndStock(str) {

console.log(str);
Http.get({
url: config.api.batchCouponPriceAndStock,
@@ -210,7 +211,8 @@ Page({
})
},
onLoad: function (options) {
app.globalData.ifCongPh = 1//固定写法 放在指定要手机号授权框出现
//固定写法 放在指定要手机号授权框出现
// app.globalData.ifCongPh = 1
this.getCouponChannelList()
},
onReachBottom: function () {
@@ -219,7 +221,7 @@ Page({
that.setData({
businePageNum: that.data.businePageNum + 1
});
console.log("加载更多页数" + that.data.page,);
console.log("加载更多页数" + that.data.page, );
console.log("加载更多key" + that.data.code);
this.getCouponChannelList(0)
},

+ 108
- 78
pages/order/detail/index.js View File

@@ -12,10 +12,10 @@ Page({
data: {
curHtml: '',
showIdFalg: false,
outOrderNo: '',//支付2.0继续支付id
payOrderNo: "",//评价订单id
evaluateFlag: false,//控制评价显隐藏
serviceUrl: '',//客服外部链接
outOrderNo: '', //支付2.0继续支付id
payOrderNo: "", //评价订单id
evaluateFlag: false, //控制评价显隐藏
serviceUrl: '', //客服外部链接
dynamicRq: "",
expiredSeconds: 0,
showhieRq: false,
@@ -52,18 +52,30 @@ Page({
orderFlag: false, //判断是不是线上配送
},
handleRefund(event) {
const { status, result } = event.detail;
const {
status,
result
} = event.detail;
if (status === 'success') {
const { refundId, outRefundNo } = result;
console.log(refundId, outRefundNo );
const {
refundId,
outRefundNo
} = result;
console.log(refundId, outRefundNo);
} else {
const { errMsg } = result;
const {
errMsg
} = result;
console.log(errMsg);
}
},
applyRefund(event) {
const { orderId } = event.detail;
const extra = { orderId }; // 开发者需要透传的参数,可自定义内容
const {
orderId
} = event.detail;
const extra = {
orderId
}; // 开发者需要透传的参数,可自定义内容
return new Promise(resolve => {
resolve(extra);
});
@@ -141,7 +153,7 @@ Page({
},
});
},
refund() {//退款
refund() { //退款
Http.post({
url: config.api.refund,
data: {
@@ -186,7 +198,7 @@ Page({
console.log(`showModal调用失败`);
},
});
} else if (this_.data.order.couponOrderStatus == 3) {//退款中
} else if (this_.data.order.couponOrderStatus == 3) { //退款中
tt.navigateTo({
url: `/pages/refund/refund?id=${this.data.order.id}`,
success: (res) => {
@@ -294,7 +306,7 @@ Page({
createDate: createDate,
composeOrderType: tempData.composeOrderType,
contentType: tempData.contentType ? tempData.contentType : 0,
orderFlag: tempData.type == 11 ? true : false,//判断是不是线上配送
orderFlag: tempData.type == 11 ? true : false, //判断是不是线上配送
})
if (tempData.couponOrderId) { //0未付款 1已支付 2已取消 3退款中 4已退款
that.setRq()
@@ -302,29 +314,29 @@ Page({
let setInter = setInterval(() => {
if (tempData.couponOrderStatus == 0) {
Http.get({
url: config.api.getStatus,
data: {
couponOrderId: tempData.couponOrderId
}
}).then(res => {
console.log(res);
that.setData({
couponOrderStatus: res.data.CouponOrderStatus
});
if (res.data.CouponOrderStatus == 1 || res.data.CouponOrderStatus == 3) {
/**
* 动态改变上一级页面的核销状态
*/
// that.getStaticGame()
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
that.updetail()
url: config.api.getStatus,
data: {
couponOrderId: tempData.couponOrderId
}
}).then(res => {
console.log(res);
that.setData({
mystatus: res.data.CouponOrderStatus
couponOrderStatus: res.data.CouponOrderStatus
});
}
})
if (res.data.CouponOrderStatus == 1 || res.data.CouponOrderStatus == 3) {
/**
* 动态改变上一级页面的核销状态
*/
// that.getStaticGame()
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
that.updetail()
that.setData({
mystatus: res.data.CouponOrderStatus
});
}
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -339,8 +351,8 @@ Page({
setInter: setInter
})
}
if (tempData.couponOrderStatus && tempData.couponOrderStatus == 1) {//核销后
that.goIfEvaluate()//判断订单是否能评价
if (tempData.couponOrderStatus && tempData.couponOrderStatus == 1) { //核销后
that.goIfEvaluate() //判断订单是否能评价
}
}).catch(error => {
console.log(error, "error");
@@ -392,9 +404,9 @@ Page({
let that = this;
// 获取用户信息
Http.get({
url: config.api.getScore,
data: {}
})
url: config.api.getScore,
data: {}
})
.then(res => {
console.log(res)
that.setData({
@@ -440,7 +452,7 @@ Page({
_this.setData({
showhieRq: false,
})
Http.get({//获取动态二维码
Http.get({ //获取动态二维码
url: config.api.dynamicId,
data: {
couponOrderId: _this.data.order.couponOrderId
@@ -541,20 +553,20 @@ Page({
getStaticGame(token) {
let _this = this;
Http.get({
url: config.api.getGame,
data: {
triggleAction: 3 // 购买触发
}
}).then(res => {
if (res.data.id) {
url: config.api.getGame,
data: {
triggleAction: 3 // 购买触发
}
}).then(res => {
if (res.data.id) {
_this.setData({
showIf: true
})
}
_this.setData({
showIf: true
staticGamedata: res.data
})
}
_this.setData({
staticGamedata: res.data
})
})
.catch(err => {
console.log(err);
})
@@ -563,7 +575,9 @@ Page({
let _this = this
tt.rateAwemeOrder({
orderId: _this.data.payOrderNo,
success({ result }) {
success({
result
}) {
console.log(result);
if (result) {
tt.navigateBack({
@@ -596,7 +610,9 @@ Page({
}).then(res => {
tt.canRateAwemeOrders({
orderIds: [res.data.payOrderNo],
success({ result }) {
success({
result
}) {
console.log("result", result);
_this.setData({
evaluateFlag: result[0],
@@ -631,7 +647,7 @@ Page({

});
tt.hideShareMenu()
if (options.cardIf) {//转赠 展示不需
if (options.cardIf) { //转赠 展示不需
that.setData({
cardIf: true
})
@@ -650,7 +666,7 @@ Page({
})
that.updetail()
},
getSeUrl() {//获取客服链接
getSeUrl() { //获取客服链接
const openId = tt.getStorageSync('openId');
Http.post({
url: config.api.getServiceUrl,
@@ -686,13 +702,13 @@ Page({
let that = this;
// 支付成功
Http.post({
url: config.api.toOrderGroup,
data: {
id: orderGroupId,
orderId,
couponId: _this.data.order.productId
}
})
url: config.api.toOrderGroup,
data: {
id: orderGroupId,
orderId,
couponId: _this.data.order.productId
}
})
.then(res => {
tt.redirectTo({
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.order.productId}&orderGroupId=${res.data.orderGroupId}`
@@ -719,7 +735,7 @@ Page({
// if (true) {//兼容不支持支付2.0 js-api !tt.canIUse('createOrder')
if (that.data.order.payment > 0) {

if (tt.canIUse('createOrder')) {//支付2.0 js-api
if (tt.canIUse('createOrder')) { //支付2.0 js-api
const outOrderNo = that.data.outOrderNo
console.log(outOrderNo, "outOrderNo");
Http.post({
@@ -744,12 +760,21 @@ Page({
that.setData({
showbutton: false,
})
const { orderId, outOrderNo } = res;
const {
orderId,
outOrderNo
} = res;
// that.setData({ orderId, outOrderNo });
that.payOrderUpdate(outOrderNo, outOrderNo, 1, '', '', that, '');
},
fail: res => {
const { orderId, outOrderNo, errNo, errMsg, errLogId } = res;
const {
orderId,
outOrderNo,
errNo,
errMsg,
errLogId
} = res;
if (errLogId) {
tt.hideLoading();
that.setData({
@@ -797,7 +822,13 @@ Page({
that.payOrderUpdate(outOrderNo, outOrderNo, 1, '', '', that); // 支付成功
},
fail: res => {
const { orderId, outOrderNo, errNo, errMsg, errLogId } = res;
const {
orderId,
outOrderNo,
errNo,
errMsg,
errLogId
} = res;
if (errLogId) {
console.log('查询订单信息失败', errNo, errMsg, errLogId);
that.setData({
@@ -835,11 +866,11 @@ Page({
icon: "none"
});
})
} else {//不支持支付2.0 js-api
} else { //不支持支付2.0 js-api
tt.showToast({
title: '请升级抖音', // 内容
icon: "none"
});
});
return
// 支付金额不为0
Http.post({
@@ -981,14 +1012,14 @@ Page({
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => {
// 支付成功
Http.post({
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
url: config.api.payOrderUpdate,
data: {
payOrderId: payOrderId,
composeOrderId: orderId,
status: status,
reason: reason
}
})
.then(res => {
tt.hideLoading();
_this.setData({
@@ -1047,5 +1078,4 @@ Page({
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
},
});

});

+ 34
- 1
project.config.json View File

@@ -1 +1,34 @@
{"setting":{"urlCheck":false,"es6":true,"newFeature":false,"postcss":false,"mockUpdate":true,"minified":false,"autoPush":false,"scripts":false,"mockLogin":false,"autoCompile":true,"localPlugins":false},"appid":"ttde7ca8c141425a2301","projectname":"tt富茂C","condition":{"miniprogram":{"current":-1,"list":[{"id":1650610427387,"name":"华莱士","pathName":"pages/main/index?type=cd&couponChannelId=123467","query":"couponChannelId=676951389111508992","scene":"990001","launchFrom":"scan","location":"qr_code"},{"id":1649905362371,"name":"add","pathName":"pages/main/index","query":"couponChannelId=702061614111186944&type=orderAffirm","scene":"990001","launchFrom":"scan","location":"qr_code"},{"id":1657681080086,"name":"手机号授权","pathName":"pages/main/index","query":"couponChannelId=710372266050117632&type=cd","scene":"990001","launchFrom":"scan","location":"qr_code"}]}}}
{
"setting": {
"urlCheck": false,
"es6": true,
"newFeature": false,
"postcss": false,
"mockUpdate": true,
"minified": false,
"autoPush": false,
"scripts": false,
"mockLogin": false,
"autoCompile": true,
"localPlugins": false,
"IDEPreviewHotRestartCache": false
},
"appid": "ttde7ca8c141425a2301",
"projectname": "tt富茂C",
"condition": {
"miniprogram": {
"current": -1,
"list": [
{
"id": 1670296113716,
"name": "pages/liveLsit/liveLsit",
"pathName": "pages/liveLsit/liveLsit",
"query": "",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
}
]
}
}
}

Loading…
Cancel
Save