HolyKnightIX před 2 roky
rodič
revize
0b39179955
4 změnil soubory, kde provedl 505 přidání a 450 odebrání
  1. +74
    -1
      .vscode/settings.json
  2. +105
    -94
      pages/coupon/detail/index.js
  3. +296
    -298
      pages/main/index.js
  4. +30
    -57
      project.config.json

+ 74
- 1
.vscode/settings.json Zobrazit soubor

@@ -1,3 +1,76 @@
{
"bytedanceMiniappIDE.previewScene": "default"
"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",
}

+ 105
- 94
pages/coupon/detail/index.js Zobrazit soubor

@@ -6,8 +6,8 @@ const util = require("../../../utils/util");
const imgurl = require("../../../utils/imgurl");
Page({
data: {
priceAndStockObj: {},//存放价格和库存
isGetUser: true,//判断是否授权抖音
priceAndStockObj: {}, //存放价格和库存
isGetUser: true, //判断是否授权抖音
mouldType: 0,
navigationBarHeight,
homeSelectedO: imgurl.homeSelectedO.url,
@@ -92,10 +92,11 @@ Page({
//图文混排
curHtml: '',
contentType: 0,
page: 1,//查询商户优惠券page
page: 1, //查询商户优惠券page
idList: [],
showBox: false,//手机号授权框
spuIdObj: {}
showBox: false, //手机号授权框
spuIdObj: {},
mallTenantId: ''
},

/**
@@ -116,39 +117,39 @@ Page({
pageSize: 5,
}
Http.post({
url: config.api.listByMerchant,
data: data
}).then(res => {
if (res.data.page.list <= 0) {
return
}
let dataLsit = []
// dataLsit = that.data.couponList
dataLsit = res.data.page.list
dataLsit.map((item, index) => {
if (item.id == that.data.couponChannelId) {
dataLsit.splice(index, 1)
url: config.api.listByMerchant,
data: data
}).then(res => {
if (res.data.page.list <= 0) {
return
}
})
if (that.data.page > 1) {
let tmpeLsit = that.data.couponList
tmpeLsit.push(...dataLsit)
that.setData({
couponList: tmpeLsit,
})
} else {
that.setData({
couponList: dataLsit,
let dataLsit = []
// dataLsit = that.data.couponList
dataLsit = res.data.page.list
dataLsit.map((item, index) => {
if (item.id == that.data.couponChannelId) {
dataLsit.splice(index, 1)
}
})
}
if (that.data.page > 1) {
let tmpeLsit = that.data.couponList
tmpeLsit.push(...dataLsit)
that.setData({
couponList: tmpeLsit,
})
} else {
that.setData({
couponList: dataLsit,
})
}


// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
// })
// }
})
// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
// })
// }
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -159,7 +160,7 @@ Page({
})
},

setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功
this.setData({
showBox: paramData.detail,
})
@@ -255,9 +256,9 @@ Page({
let that = this;
// 获取用户信息
Http.get({
url: config.api.getScore,
data: {}
})
url: config.api.getScore,
data: {}
})
.then(res => {
console.log(res)
that.getQueryCardStatus()
@@ -278,9 +279,9 @@ Page({
updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss")
}
Http.get({
url: config.api.queryCardStatus,
data: param
})
url: config.api.queryCardStatus,
data: param
})
.then(res => {
console.log(res, 333333333333)
})
@@ -303,9 +304,9 @@ Page({
receivedDisabled: true
})
Http.post({
url: config.api.cardAccept,
data: param
})
url: config.api.cardAccept,
data: param
})
.then(res => {
tt.showToast({
title: '领取成功!',
@@ -360,12 +361,12 @@ Page({
console.log(answserIs)
console.log(e.currentTarget.dataset.questionid)
Http.post({
url: config.api.answerQuestion,
data: {
answer: answserIs,
questionId: e.currentTarget.dataset.questionid
}
})
url: config.api.answerQuestion,
data: {
answer: answserIs,
questionId: e.currentTarget.dataset.questionid
}
})
.then(res => {
that.closeQuestion();
})
@@ -405,8 +406,7 @@ Page({
data: {
token: app.globalData.token
}
}).then(res => {
}).catch(err => {
}).then(res => {}).catch(err => {
if (err.code == 11004) {
this.setData({
isGetUser: false
@@ -484,6 +484,11 @@ Page({
*/
onLoad(options) {
console.log(options);
if (options.mallTenantId) {
this.setData({
mallTenantId: options.mallTenantId,
})
}

this.setData({
mouldType: app.globalData.mouldType,
@@ -552,7 +557,9 @@ Page({
getSupId(id) {
Http.get({
url: config.api.getSpuid,
data: { id: id }
data: {
id: id
}
}).then(res => {
if (res.data) {
this.setData({
@@ -569,11 +576,12 @@ Page({
})
},

getCouponPriceAndStock(couponChannelId) {//获取券价格与库存
getCouponPriceAndStock(couponChannelId) { //获取券价格与库存
Http.get({
url: config.api.couponPriceAndStock,
data: {
couponChannelId
couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
let tempBoj = JSON.parse(res.data)
@@ -583,10 +591,10 @@ Page({
})
})
},
getCouponMerchant(couponChannelId) {//获取适用门店
getCouponMerchant(couponChannelId) { //获取适用门店
Http.get({
url: config.api.couponMerchant,
data: {
data: {
couponChannelId: couponChannelId
}
}).then(res => {
@@ -610,14 +618,17 @@ Page({
getDetail: function (couponChannelId, flag) {
let that = this;
let data = {};
that.getCouponMerchant(couponChannelId);//获取适用门店
that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存
that.getCouponMerchant(couponChannelId); //获取适用门店
that.getCouponPriceAndStock(couponChannelId); //获取券价格和库存

if (that.data.couponIds) {
data.couponId = couponChannelId
} else {
data.couponChannelId = couponChannelId
}
if (that.data.mallTenantId) {
data.mallTenantId = that.data.mallTenantId
}
var parmer = {
url: config.api.newCouponDetail,
data: data
@@ -684,7 +695,7 @@ Page({
});
var EndTime = res.data.validStartDate;
var NowTime = new Date().getTime();
/**
* activityStatus==0 活动未开始
* activityStatus==1 活动已开始
@@ -756,7 +767,7 @@ Page({
}
}


if (res.data.itemGroup) {
let tempObj = this.data.data
@@ -783,7 +794,7 @@ Page({
} else if (tempAppoinObj.ahead_time_type == 3) {
subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟致电商家预约`
}
tempObj.subscribeSing = subscribeSing
tempObj.subscribeSing = subscribeSing
}

}
@@ -818,8 +829,8 @@ Page({
}
})
tempObj.skuAttrs.map(item => {
if (item.key == "commodity"&&item.data) {
tempObj.itemGroup = JSON.parse(item.data)
if (item.key == "commodity" && item.data) {
tempObj.itemGroup = JSON.parse(item.data)
}
})
this.setData({
@@ -855,14 +866,14 @@ Page({
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()
// 有价券
@@ -890,9 +901,9 @@ Page({
checkPhoneStatus: function () {
let that = this;
Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
console.log(666, '授权成功!')
that.receiveCard()
@@ -978,7 +989,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}`,
})
@@ -1003,7 +1014,7 @@ Page({


onShow() {
this.ifGetUser()//判断是否授权抖音
this.ifGetUser() //判断是否授权抖音
this.setData({
mouldType: app.globalData.mouldType,
showbutton: false,
@@ -1031,7 +1042,7 @@ Page({
title: that.data.data.title,
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}`,
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') { }
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function (err) {
// if (err.errMsg == 'shareAppMessage:fail cancel') { } else if (err.errMsg == 'shareAppMessage:fail') { }
@@ -1043,23 +1054,23 @@ Page({
shareObj.path = `/pages/index/index?couponChannelId=${eData}&frommd=JC`;

} else
if (options.channel == 'video') {
// return {
// channel: 'video', // 必写 video
//     templateId: '',   // 分享的模版 id (如果未设置就是默认,下面会说如何设置)
// title: `${that.data.barTitle}`,     // 分享的标题
// desc: `${that.data.data.dyTitle}`,     // 分享的内容介绍目前没有用
//     path: `/pages/index/index`,  // 分享的路径
// extra: {
// videoTopics: [ that.data.data.dyTitle] // 只有抖音才会有的属性
// },
// }
shareObj.channel = 'video';
shareObj.title = `${that.data.data.title}`;
shareObj.extra = {
spu_id: that.data.spuIdObj.spuId
}
if (options.channel == 'video') {
// return {
// channel: 'video', // 必写 video
//     templateId: '',   // 分享的模版 id (如果未设置就是默认,下面会说如何设置)
// title: `${that.data.barTitle}`,     // 分享的标题
// desc: `${that.data.data.dyTitle}`,     // 分享的内容介绍目前没有用
//     path: `/pages/index/index`,  // 分享的路径
// extra: {
// videoTopics: [ that.data.data.dyTitle] // 只有抖音才会有的属性
// },
// }
shareObj.channel = 'video';
shareObj.title = `${that.data.data.title}`;
shareObj.extra = {
spu_id: that.data.spuIdObj.spuId
}
}
console.log(shareObj)

// 返回shareObj


+ 296
- 298
pages/main/index.js Zobrazit soubor

@@ -1,4 +1,3 @@

const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl");
const config = require("../../config/config");
@@ -12,19 +11,19 @@ Page({
* 生命周期函数--监听页面加载
*/

getCongig(){//获取小程序是否开通授权手机号
getCongig() { //获取小程序是否开通授权手机号
Http.get({
url:config.api.getConfig,
data:{
key:"douyinPhoneStatus"
url: config.api.getConfig,
data: {
key: "douyinPhoneStatus"
}
}).then(res=>{
app.globalData.ifCongPh = res.data?res.data:1
}).catch(err=>{
}).then(res => {
app.globalData.ifCongPh = res.data ? res.data : 1
}).catch(err => {
app.globalData.ifCongPh = 1
})
},
onLoad: function(options) {
onLoad: function (options) {
let that = this;
console.log(options, "跳转地址栏");
tt.showToast({
@@ -86,9 +85,9 @@ Page({
//活动签到
options.id = this.data.newArr[2];
} else if (options.type == 'wj') {
options.id = this.data.newArr[2];
options.id = this.data.newArr[2];
} else if (options.type == 'wjLsit') {
options.id = this.data.newArr[2];
options.id = this.data.newArr[2];
}
}
}
@@ -122,7 +121,7 @@ Page({
/**
* 检查用户的状态
*/
userStatus: function(options) {
userStatus: function (options) {
var that = this;
if (options && (options.couponChannelId || options.orderId || options.id)) {
that.checkuserstatus(options);
@@ -150,316 +149,137 @@ Page({

checkuserstatus(options) {
let that = this;
if(options && options.couponChannelId&&options.type=='orderAffirm'){
if (options && options.couponChannelId && options.type == 'orderAffirm') {
tt.redirectTo({
url:`/pages/coupon/confirmation/confirmation?couponChannelId=${options.couponChannelId}`
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${options.couponChannelId}`
})
}
if(options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd'){
if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') {
if (options.cuserId) {
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`,
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}&mallTenantId=${options.tenantId}`,
})
} else {
// 跳转普通券/消费卡/限时秒杀/砍价详情
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`,
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&mallTenantId=${options.tenantId}`,
})
}
}else{
} else {
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
})
.then(res => {
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}')
//参与拼团
if(options && options.orderId && app.globalData.type == 'dt'){
//订单详情
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${options.orderId}`
})
}else if (options && options.orderGroupId) {
tt.redirectTo({
url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
})
}
//来自大屏的跳转拼团券详情
else if (options && options.couponChannelId && options.path == 'daping') {
/**
* 主要是为了拿couponId
*/
Http.get({
url: config.api.couponDetail,
data: {
couponChannelId: options.couponChannelId
}
}).then(res => {
let data = res.data;
tt.redirectTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}&couponId=${data.couponId}`
})
})
} else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') {
// 转赠判断
if (options.cuserId) {
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
})
.then(res => {
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}')
//参与拼团
if (options && options.orderId && app.globalData.type == 'dt') {
//订单详情
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`,
url: `/pages/order/detail/index?orderId=${options.orderId}`
})
} else {
// 跳转普通券/消费卡/限时秒杀/砍价详情
} else if (options && options.orderGroupId) {
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`,
url: `/pages/joinFrDpell/index?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
})
}
}
// 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口)
else if ((options && options.couponChannelId && app.globalData.type == 'sd') || (options && options.couponChannelId && options.spellGroup)) {
tt.redirectTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`,
})
}
// 游戏页面
else if (options && options.id && app.globalData.type == 'gm') {
that.getGameOne(app.globalData.token, options.id)
}
// 报名活动页面
else if (options && options.id && app.globalData.type == 'ra') {
tt.redirectTo({
url: `/pages/radetail/index?id=${options.id}`,
})
}
//活动签到
else if (options && options.id && app.globalData.type == 'si') {
tt.redirectTo({
url: `/pages/acSignIn/index?id=${options.id}`,
})
}else if(app.globalData.type == 'wjLsit'){//问卷调查
tt.redirectTo({
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
})
}
//问卷答题
else if (options && options.id && app.globalData.type == 'wj') {
tt.redirectTo({
url: `/pages/questionnaire/questionnaire?id=${options.id}`,
})
}
// 宣传页详情
else if (options && options.bt && options.id && app.globalData.type == 'bd') {
if (options.bt == '2') {
// 自由图文
tt.redirectTo({
url: `/pages/freeBannerDetail/index?id=${options.id}`,
})
} else {
// 标准格式
tt.redirectTo({
url: `/pages/bannerdetail/index?id=${options.id}`,
//来自大屏的跳转拼团券详情
else if (options && options.couponChannelId && options.path == 'daping') {
/**
* 主要是为了拿couponId
*/
Http.get({
url: config.api.couponDetail,
data: {
couponChannelId: options.couponChannelId
}
}).then(res => {
let data = res.data;
tt.redirectTo({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}&couponId=${data.couponId}`
})
})
} else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') {
// 转赠判断
if (options.cuserId) {
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`,
})
} else {
// 跳转普通券/消费卡/限时秒杀/砍价详情
tt.redirectTo({
url: `/pages/coupon/detail/index?couponChannelId=${options.couponChannelId}`,
})
}
}
}
// 专题
else if (options && options.id && app.globalData.type == 'td') {
tt.redirectTo({
url: `/pages/topicDetail/index?id=${options.id}`
});
}
// 门店详情
else if (options && options.id && app.globalData.type == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
}
// 参与砍价
else if (options && options.orderId) {
tt.redirectTo({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`,
})
}
// 我的
else if (app.globalData.type == 'uc') {
tt.navigateTo({
url: '/index/user'
});
}
// 积分
else if (app.globalData.type == 'jf') {
tt.redirectTo({
url: '/pages/integralmall/index'
});
}
// 首页
else if (app.globalData.type == 'in') {
tt.reLaunch({
url: '/index/index'
});
}
// 停车
else if (app.globalData.type == 'pc') {
// 停车
tt.navigateTo({
url: '/index/passCar'
});
}
// 我的券包
else if (app.globalData.type == 'mc') {
// 我的券包
tt.redirectTo({
url: '/pages/couponorder/index/index'
});
}
// 我的订单
else if (app.globalData.type == 'mo') {
// 我的订单
tt.redirectTo({
url: '/pages/order/index/index?id=all'
});
}
// 我的卡包
else if (app.globalData.type == 'ca') {
// 我的卡包
tt.redirectTo({
url: '/pages/cardorder/index/index'
});
}
// 特享礼遇
else if (app.globalData.type == 'sc') {
// 特享礼遇
tt.redirectTo({
url: '/pages/specialcourtesy/specialcourtesy'
});
}
// 限时秒杀
else if (app.globalData.type == 'rb') {
// 限时秒杀
tt.redirectTo({
url: '/pages/rushToBuy/index'
})
}
// 砍价专场
else if (app.globalData.type == 'bl') {
// 砍价专场
tt.redirectTo({
url: '/pages/bargain/bargain'
})
}
// 我的砍价
else if (app.globalData.type == 'mb') {
// 我的砍价
tt.redirectTo({
url: '/pages/bargain/bargain?from=myhtml'
})
}
// 拼团专场
else if (app.globalData.type == 'sl') {
// 拼团专场
tt.redirectTo({
url: '/pages/spellGroup/spellGroup'
})
}
// 我的拼团
else if (app.globalData.type == 'ms') {
// 我的拼团
tt.redirectTo({
url: '/pages/spellGroup/spellGroup?from=myhtml'
})
}
// 消费卡
else if (app.globalData.type == 'dc') {
// 消费卡
tt.redirectTo({
url: '/pages/discountCardList/discountCardList'
})
}
// 门店
else if (app.globalData.type == 'ml') {
tt.navigateTo({
url: '/index/searchbar'
})
}
// 兑换
else if (app.globalData.type == 'ec') {
tt.redirectTo({
url: '/pages/exchange/exchange'
})
}
// 通过分享进入的门店详情
else if (options && options.id && options.frommd == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
} else {
// 主页
tt.reLaunch({
url: '/index/index'
})
}
})
.catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
if (options && options.orderGroupId) {
// 拼团详情页(只有通过扫码进入才可能进入拼团详情页面,只有这一个入口)
else if ((options && options.couponChannelId && app.globalData.type == 'sd') || (options && options.couponChannelId && options.spellGroup)) {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${options.couponChannelId}`,
})
}
/**
* spellGroup
* 区分是通过拼团详情分享过来的还是从普通券分享过来的
* 注意:拼团券和普通券是两个页面
*/
if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) {
// 游戏页面
else if (options && options.id && app.globalData.type == 'gm') {
that.getGameOne(app.globalData.token, options.id)
}
// 报名活动页面
else if (options && options.id && app.globalData.type == 'ra') {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}`
url: `/pages/radetail/index?id=${options.id}`,
})
} else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) {
}
//活动签到
else if (options && options.id && app.globalData.type == 'si') {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}`
url: `/pages/acSignIn/index?id=${options.id}`,
})
} else if (options && options.couponChannelId && options.cuserId) {
/**
* 转赠判断
*/
} else if (app.globalData.type == 'wjLsit') { //问卷调查
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
})
} else if (options && options.orderId) {
}
//问卷答题
else if (options && options.id && app.globalData.type == 'wj') {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?orderId=${options.orderId}&from='${"discount"}`
url: `/pages/questionnaire/questionnaire?id=${options.id}`,
})
}
// 通过分享进入的门店详情
else if (options && options.id && options.frommd == 'md') {
// 宣传页详情
else if (options && options.bt && options.id && app.globalData.type == 'bd') {
if (options.bt == '2') {
// 自由图文
tt.redirectTo({
url: `/pages/freeBannerDetail/index?id=${options.id}`,
})
} else {
// 标准格式
tt.redirectTo({
url: `/pages/bannerdetail/index?id=${options.id}`,
})
}
}
// 专题
else if (options && options.id && app.globalData.type == 'td') {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?id=${options.id}&frommd=md`
url: `/pages/topicDetail/index?id=${options.id}`
});
} // 门店详情
}
// 门店详情
else if (options && options.id && app.globalData.type == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
}
else if(app.globalData.type == 'wjLsit'){//问卷调查
tt.redirectTo({
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
})
}
// 答题问卷
else if (options && options.id && app.globalData.type == 'wj') {
// 参与砍价
else if (options && options.orderId) {
tt.redirectTo({
url: `/pages/questionnaire/questionnaire?id=${options.id}`,
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`,
})
}
// 报名活动页面
else if (options && options.id && app.globalData.type == 'ra') {
tt.redirectTo({
url: `/pages/radetail/index?id=${options.id}`,
})
} else if (app.globalData.type == 'uc') {
// 我的
else if (app.globalData.type == 'uc') {
tt.navigateTo({
url: '/index/user'
});
@@ -470,12 +290,6 @@ Page({
url: '/pages/integralmall/index'
});
}
// 专题
else if (options && options.id && app.globalData.type == 'td') {
tt.redirectTo({
url: `/pages/topicDetail/index?id=${options.id}`
});
}
// 首页
else if (app.globalData.type == 'in') {
tt.reLaunch({
@@ -547,6 +361,7 @@ Page({
}
// 我的拼团
else if (app.globalData.type == 'ms') {
// 我的拼团
tt.redirectTo({
url: '/pages/spellGroup/spellGroup?from=myhtml'
})
@@ -558,29 +373,212 @@ Page({
url: '/pages/discountCardList/discountCardList'
})
}
// 门店
else if (app.globalData.type == 'ml') {
tt.navigateTo({
url: '/index/searchbar'
})
}
// 兑换
else if (app.globalData.type == 'ec') {
tt.redirectTo({
url: '/pages/exchange/exchange'
})
}
// 门店
else if (app.globalData.type == 'ml') {
tt.navigateTo({
url: '/index/searchbar'
})
// 通过分享进入的门店详情
else if (options && options.id && options.frommd == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
} else {
// 主页
tt.reLaunch({
url: '/index/index',
url: '/index/index'
})
}
}
})
})
.catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
if (options && options.orderGroupId) {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}&orderId=${options.orderId}&avatarUrl=${options.avatarUrl}&nickName=${options.nickName}`
})
}
/**
* spellGroup
* 区分是通过拼团详情分享过来的还是从普通券分享过来的
* 注意:拼团券和普通券是两个页面
*/
if (options && options.couponChannelId && !options.cuserId && !options.spellGroup) {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}`
})
} else if (options && options.couponChannelId && !options.cuserId && options.spellGroup) {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&spellGroup=${options.spellGroup}`
})
} else if (options && options.couponChannelId && options.cuserId) {
/**
* 转赠判断
*/
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?couponChannelId=${options.couponChannelId}&cuserId=${options.cuserId}&coverImg=${options.coverImg}&userName=${options.userName}&avatarUrl=${options.avatarUrl}&couponOrderId=${options.couponOrderId}&updateDate=${options.updateDate}`
})
} else if (options && options.orderId) {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?orderId=${options.orderId}&from='${"discount"}`
})
}
// 通过分享进入的门店详情
else if (options && options.id && options.frommd == 'md') {
tt.redirectTo({
url: `/pages/getuserinfo/getuserinfo?id=${options.id}&frommd=md`
});
} // 门店详情
else if (options && options.id && app.globalData.type == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
} else if (app.globalData.type == 'wjLsit') { //问卷调查
tt.redirectTo({
url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`,
})
}
// 答题问卷
else if (options && options.id && app.globalData.type == 'wj') {
tt.redirectTo({
url: `/pages/questionnaire/questionnaire?id=${options.id}`,
})
}
// 报名活动页面
else if (options && options.id && app.globalData.type == 'ra') {
tt.redirectTo({
url: `/pages/radetail/index?id=${options.id}`,
})
} else if (app.globalData.type == 'uc') {
tt.navigateTo({
url: '/index/user'
});
}
// 积分
else if (app.globalData.type == 'jf') {
tt.redirectTo({
url: '/pages/integralmall/index'
});
}
// 专题
else if (options && options.id && app.globalData.type == 'td') {
tt.redirectTo({
url: `/pages/topicDetail/index?id=${options.id}`
});
}
// 首页
else if (app.globalData.type == 'in') {
tt.reLaunch({
url: '/index/index'
});
}
// 停车
else if (app.globalData.type == 'pc') {
// 停车
tt.navigateTo({
url: '/index/passCar'
});
}
// 我的券包
else if (app.globalData.type == 'mc') {
// 我的券包
tt.redirectTo({
url: '/pages/couponorder/index/index'
});
}
// 我的订单
else if (app.globalData.type == 'mo') {
// 我的订单
tt.redirectTo({
url: '/pages/order/index/index?id=all'
});
}
// 我的卡包
else if (app.globalData.type == 'ca') {
// 我的卡包
tt.redirectTo({
url: '/pages/cardorder/index/index'
});
}
// 特享礼遇
else if (app.globalData.type == 'sc') {
// 特享礼遇
tt.redirectTo({
url: '/pages/specialcourtesy/specialcourtesy'
});
}
// 限时秒杀
else if (app.globalData.type == 'rb') {
// 限时秒杀
tt.redirectTo({
url: '/pages/rushToBuy/index'
})
}
// 砍价专场
else if (app.globalData.type == 'bl') {
// 砍价专场
tt.redirectTo({
url: '/pages/bargain/bargain'
})
}
// 我的砍价
else if (app.globalData.type == 'mb') {
// 我的砍价
tt.redirectTo({
url: '/pages/bargain/bargain?from=myhtml'
})
}
// 拼团专场
else if (app.globalData.type == 'sl') {
// 拼团专场
tt.redirectTo({
url: '/pages/spellGroup/spellGroup'
})
}
// 我的拼团
else if (app.globalData.type == 'ms') {
tt.redirectTo({
url: '/pages/spellGroup/spellGroup?from=myhtml'
})
}
// 消费卡
else if (app.globalData.type == 'dc') {
// 消费卡
tt.redirectTo({
url: '/pages/discountCardList/discountCardList'
})
}
// 兑换
else if (app.globalData.type == 'ec') {
tt.redirectTo({
url: '/pages/exchange/exchange'
})
}
// 门店
else if (app.globalData.type == 'ml') {
tt.navigateTo({
url: '/index/searchbar'
})
} else {
tt.reLaunch({
url: '/index/index',
})
}
}
})
}
},

getGameOne: function(token, id) {
getGameOne: function (token, id) {
let _this = this;
Http.get({
url: config.api.getOneGame,
@@ -598,7 +596,7 @@ Page({
title: '提示',
content: err.message,
showCancel: false,
success: function(res) {
success: function (res) {
// 如果游戏下架或者找不到,重启首页
if (res.confirm) {
tt.reLaunch({


+ 30
- 57
project.config.json Zobrazit soubor

@@ -1,61 +1,34 @@
{
"setting": {
"urlCheck": true,
"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": 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"
},
{
"id": 1665480010958,
"name": "pages/coupon/detail/index",
"pathName": "pages/coupon/detail/index",
"query": "",
"scene": "",
"launchFrom": "",
"location": ""
}
]
"setting": {
"urlCheck": true,
"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": 1669558749378,
"name": "商品详情页",
"pathName": "pages/main/index",
"query": "pages/main/index?type=cd&couponChannelId=756802201412231168&tenantId=1034",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
}
]
}
}
}

Načítá se…
Zrušit
Uložit