比较提交

...

68 次代码提交

作者 SHA1 备注 提交日期
  HolyKnightIX 93d6262d04 upload 2 年前
  HolyKnightIX 16e551551b nothing 2 年前
  HolyKnightIX c2b172f411 upload 2 年前
  HolyKnightIX f51d9a9e11 upload 2 年前
  HolyKnightIX aa6cd35d82 扫码进入小程序返回首页bug 2 年前
  HolyKnightIX fafd6a5ecf upload 2 年前
  HolyKnightIX 16d9309fbf upload 2 年前
  HolyKnightIX 8685b56246 upload 2 年前
  HolyKnightIX d790cc0a0f upload 2 年前
  HolyKnightIX dda1d3cff6 upload 2 年前
  HolyKnightIX 54cd699cdc upload 2 年前
  HolyKnightIX 382bcec80b upload 2 年前
  HolyKnightIX 51a441c22b upload 2 年前
  HolyKnightIX 79fbb9ff2a upload 2 年前
  HolyKnightIX 3c89a4056c upload 2 年前
  HolyKnightIX d6d6a124a4 upload 2 年前
  HolyKnightIX b53e10d327 upload 2 年前
  HolyKnightIX 0716135a1e upload 2 年前
  HolyKnightIX 148648e4ee upload 2 年前
  HolyKnightIX f9d7619a79 upload 2 年前
  HolyKnightIX de0169bd63 upload 2 年前
  HolyKnightIX 2147bacac4 upload 2 年前
  HolyKnightIX 4dd77cc89d upload 2 年前
  HolyKnightIX 97dc1cea33 upload 2 年前
  HolyKnightIX 7b86d105b0 upload 2 年前
  HolyKnightIX 0d9c27fd2d uplaod 2 年前
  HolyKnightIX 158a4698ce upload 2 年前
  HolyKnightIX 32de07c0b7 upload 2 年前
  HolyKnightIX 3f6bd488a9 upload 2 年前
  HolyKnightIX 80703ce109 upload 2 年前
  HolyKnightIX e99eab0e2b upload 2 年前
  HolyKnightIX 0ec4be8bd8 upload 2 年前
  HolyKnightIX 6d230ced7e 数据迁移 2 年前
  HolyKnightIX d9a214ff26 定位到最近的广场 2 年前
  HolyKnightIX 945da121e3 upload 2 年前
  HolyKnightIX 51366c1fac 距离排序 2 年前
  HolyKnightIX 64dba290dd 首页修改 2 年前
  HolyKnightIX 5ee8b8a5ec 定位与选择广场 2 年前
  HolyKnightIX 440e6fbfd4 upload 2 年前
  HolyKnightIX 6003d0b8a7 upload 2 年前
  HolyKnightIX b7391aef7b upload 2 年前
  HolyKnightIX f72c87012b 子广场券包显示异常 2 年前
  HolyKnightIX 01e50f4c2d 广场筛选 2 年前
  HolyKnightIX 5cf245d1c1 广场筛选按钮 2 年前
  HolyKnightIX dada49dd18 bug修改 2 年前
  HolyKnightIX 6893de9ff9 C端券包页面,添加集团和子广场筛选 2 年前
  HolyKnightIX 624260f4f4 门店展示#6、 2 年前
  HolyKnightIX 7ba488db44 集团版商户显示#4 2 年前
  HolyKnightIX 476cdb0442 使用门店样式优化 2 年前
  HolyKnightIX a0aa2e7452 适用门店新模式#3 2 年前
  HolyKnightIX 7d226e1a9c 商户列表优化 2 年前
  HolyKnightIX 252e84ab8f 适用门店 2 年前
  HolyKnightIX c268cb3c85 商场门店 2 年前
  HolyKnightIX 58e3a4e2f3 Merge branch 'newEdition' of https://git.malls.iformall.com/weapp/ttc into newEdition 2 年前
  HolyKnightIX 47e3435498 setting 2 年前
  HolyKnightIX fe7571d7b6 获取使用门店数据修改 2 年前
  HolyKnightIX cd4564fa94 集团版同步 2 年前
  HolyKnightIX f7182ea0c1 upload 2 年前
  HolyKnightIX 9e60a1b644 uselessCommit 2 年前
  HolyKnightIX 603084ae3a upload 2 年前
  HolyKnightIX ce306722c2 动态码数据新增 2 年前
  HolyKnightIX e55f5806a2 二维码调试、选择广场调试 2 年前
  HolyKnightIX 8c457a6521 商品详情、支付、退款 2 年前
  HolyKnightIX 0b39179955 upload 2 年前
  HolyKnightIX e0b699a957 支付修改 2 年前
  HolyKnightIX 1145be18f1 支付修改 2 年前
  HolyKnightIX e2ca85bad8 upload 2 年前
  HolyKnightIX 7acafdbcc2 获取验证码页面修复 2 年前
共有 72 个文件被更改,包括 4904 次插入3012 次删除
  1. +119
    -2
      .vscode/settings.json
  2. +45
    -43
      app.js
  3. +2
    -2
      app.json
  4. 二进制
      assets/images/location(1).png
  5. 二进制
      assets/images/location(2).png
  6. 二进制
      assets/images/location(3).png
  7. 二进制
      assets/images/location(4).png
  8. 二进制
      assets/images/location.png
  9. 二进制
      assets/itemImg/arrow-right-l.png
  10. 二进制
      assets/itemImg/arrow-right-l2.png
  11. 二进制
      assets/itemImg/arrow-right-l3.png
  12. 二进制
      assets/itemImg/filter-golden.png
  13. 二进制
      assets/itemImg/filter.png
  14. 二进制
      assets/itemImg/merchantImgCover.png
  15. +17
    -17
      components/banner/index.js
  16. +4
    -1
      components/coupons/index.js
  17. +9
    -7
      components/coupons/index.ttml
  18. +14
    -13
      components/optimization/optimization.js
  19. +39
    -35
      components/optimization/optimization.ttml
  20. +287
    -246
      components/optimization/optimization.ttss
  21. +101
    -0
      components/shop/shop.js
  22. +3
    -0
      components/shop/shop.json
  23. +230
    -0
      components/shop/shop.less
  24. +64
    -0
      components/shop/shop.ttml
  25. +187
    -0
      components/shop/shop.ttss
  26. +24
    -23
      components/store/index.js
  27. +9
    -7
      components/store/index.ttml
  28. +12
    -13
      components/tabbar/tabbar.js
  29. +10
    -19
      ext.json
  30. +560
    -278
      index/index.js
  31. +16
    -18
      index/index.json
  32. +52
    -145
      index/index.ttml
  33. +50
    -20
      index/index.ttss
  34. +120
    -0
      index/indexOld.txt
  35. +16
    -13
      index/searchbar.js
  36. +28
    -21
      index/user.js
  37. +33
    -24
      index/user.ttml
  38. +5
    -4
      pages/bannerdetail/bannerdetail.js
  39. +305
    -213
      pages/coupon/confirmation/confirmation.js
  40. +1
    -1
      pages/coupon/confirmation/confirmation.json
  41. +7
    -5
      pages/coupon/confirmation/confirmation.ttml
  42. +196
    -147
      pages/coupon/detail/index.js
  43. +13
    -12
      pages/coupon/detail/index.json
  44. +39
    -30
      pages/coupon/detail/index.ttml
  45. +131
    -68
      pages/couponorder/detail/index.js
  46. +8
    -7
      pages/couponorder/detail/index.json
  47. +19
    -17
      pages/couponorder/detail/index.ttml
  48. +88
    -52
      pages/couponorder/index/index.js
  49. +16
    -4
      pages/couponorder/index/index.ttml
  50. +198
    -162
      pages/couponorder/index/index.ttss
  51. +16
    -12
      pages/edit/edit.ttml
  52. +18
    -16
      pages/getPhone/getPhone.js
  53. +271
    -251
      pages/getuserinfo/getuserinfo.js
  54. +26
    -25
      pages/index/index.js
  55. +50
    -38
      pages/index/searchbar/detail/index.js
  56. +80
    -47
      pages/index/searchbar/detail/index.ttss
  57. +33
    -25
      pages/integralmall/payIntegcoupondetail/index.js
  58. +32
    -18
      pages/liveLsit/liveLsit.js
  59. +7
    -8
      pages/liveLsit/liveLsit.ttml
  60. +332
    -301
      pages/main/index.js
  61. +196
    -100
      pages/order/detail/index.js
  62. +8
    -7
      pages/order/detail/index.json
  63. +169
    -158
      pages/order/detail/index.ttml
  64. +158
    -124
      pages/order/index/index.js
  65. +23
    -6
      pages/order/index/index.ttml
  66. +127
    -73
      pages/order/index/index.ttss
  67. +58
    -58
      pages/orderquanma/index.js
  68. +60
    -30
      pages/paySnapshoot/paySnapshoot.js
  69. +26
    -22
      pages/paySnapshoot/paySnapshoot.ttml
  70. +15
    -13
      pages/refund/refund.js
  71. +88
    -1
      project.config.json
  72. +34
    -10
      utils/HttpBasics.js

+ 119
- 2
.vscode/settings.json 查看文件

@@ -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",
}

+ 45
- 43
app.js 查看文件

@@ -1,44 +1,44 @@
const Http = require("./utils/HttpBasics.js")
const config = require("./config/config.js");
App({
data:{},
globalData:{
data: {},
globalData: {
token: null,
imgHttps: 'https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/',
platform:null,//手机型号
systemInfo:"",
curHtml:"",
marketName:"",
mouldType:1,
appId:config.weapp.AppId,
selected:0,
goHomeUrl:"/index/index",
type:"",//存放跳转标记
platform: null, //手机型号
systemInfo: "",
curHtml: "",
marketName: "",
mouldType: 1,
appId: config.weapp.AppId,
selected: 0,
goHomeUrl: "/index/index",
type: "", //存放跳转标记
previewFlag: false, //解决图片预览调用noshow
skipUrl:"",//存放授权跳转地址
skip:"",
avatarUrl:"",//用户头像
nickName:"",//用户姓名
templateId:[],//订阅消息模板id
ifshowtab:false,
skipUrl: "", //存放授权跳转地址
skip: "",
avatarUrl: "", //用户头像
nickName: "", //用户姓名
templateId: [], //订阅消息模板id
ifshowtab: false,
},
onLaunch: function () {
let that = this
tt.setStorageSync('locationFlag', true);
try {
var res = tt.getSystemInfoSync();
that.statusBarHeight = res.statusBarHeight
console.log(`手机型号为`,that.statusBarHeight);
console.log(`手机型号为`, that.statusBarHeight);
this.globalData.platform = res.platform
} catch (error) {
console.log(`获取系统信息失败`);
}
that.logn();
that.login();
tt.getSystemInfo({
success(res) {
console.log(res,"**");
console.log(res, "**");
that.globalData.systemInfo = res
},
fail(res) {
console.log(`getSystemInfo 调用失败`);
@@ -46,7 +46,7 @@ App({
});

},
statusBarHeight: 0,
getTemplateId(that) {
// console.log("隐藏")
@@ -72,42 +72,45 @@ App({
}
})
},
logn(){

login() {
console.log('login!');
let that = this;
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:that.globalData.appId,
systemInfo:JSON.stringify(this.globalData.systemInfo)
url: config.api.login,
data: {
code: code,
appId: that.globalData.appId,
systemInfo: JSON.stringify(this.globalData.systemInfo)
}
}).then(res=>{
}).then(res => {
tt.setStorageSync("openId", res.data.openId);
if (res.data.mall){
if (res.data.mall) {
that.globalData.marketName = res.data.mall.name ? res.data.mall.name : ""
}
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType:0;
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType : 0;
if (res.data.subMalls) {
const squareList = JSON.parse(res.data.subMalls)
tt.setStorageSync("squareList", squareList)
if (res.data.mall){
if (res.data.mall) {
tt.setStorageSync("selectedMall", res.data.mall.tenantId)
}
}
Http.setToken(res.data.token);
that.globalData.token = res.data.token
that.getTemplateId(that);//获取订阅消息模板id
// that.getTemplateId(that); //获取订阅消息模板id
if (that.tokenCallback) {
that.tokenCallback(res.data.token);
}
}).catch(err=>{
console.log(err);
}).catch(err => {
console.log(err, 'getUserInfo');
tt.showModal({
title: '提示',
showCancel: false,
@@ -126,7 +129,6 @@ App({
})

}),

});
}
})
})

+ 2
- 2
app.json 查看文件

@@ -36,7 +36,7 @@
"pages/refund/refund",
"pages/serviceWebView/serviceWebView",
"pages/liveLsit/liveLsit",
"pages/coupon/confirmation/confirmation",
"pages/coupon/confirmation/confirmation",
"pages/coupon/instructions/instructions"
],
"window": {
@@ -44,5 +44,5 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
}

二进制
assets/images/location(1).png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 5.4 KiB

二进制
assets/images/location(2).png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 7.6 KiB

二进制
assets/images/location(3).png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 3.7 KiB

二进制
assets/images/location(4).png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 5.0 KiB

二进制
assets/images/location.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 5.7 KiB

二进制
assets/itemImg/arrow-right-l.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 1.1 KiB

二进制
assets/itemImg/arrow-right-l2.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 1.8 KiB

二进制
assets/itemImg/arrow-right-l3.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 1.6 KiB

二进制
assets/itemImg/filter-golden.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 3.8 KiB

二进制
assets/itemImg/filter.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 3.5 KiB

二进制
assets/itemImg/merchantImgCover.png 查看文件

之前 之后
宽度: 128  |  高度: 128  |  大小: 1.7 KiB

+ 17
- 17
components/banner/index.js 查看文件

@@ -19,44 +19,45 @@ Component({
data: {
bannerUrl: imgurl.banner.url,
currentIndex: 0,
mouldType:0,
mouldType: 0,
},

/**
* 组件的方法列表
*/
methods: {
gotobannerdetail: function(e) {
gotobannerdetail: function (e) {
console.log(e, 'e');

console.log(this.data.list)
if (e.currentTarget.dataset.data.type == 3) {
// 小程序路径
let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("=");
console.log(indexOf, "123")
let id = (e.currentTarget.dataset.data.pagePath).substr(indexOf);
console.log(id.split("="),123);
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2)// 2020/7/22 变量获取pagePath中的type
console.log(id.split("="), 123);
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2) // 2020/7/22 变量获取pagePath中的type
console.log(indexOf, id, type);
console.log(e.currentTarget.dataset.data.pagePath)
if(type == 'cd' || type == 'sd'){
if (type == 'cd' || type == 'sd') {
tt.navigateTo({
url: `/${e.currentTarget.dataset.data.pagePath}`,
})
}else if(type == "wj"){
} else if (type == "wj") {
tt.navigateTo({
url: `/pages/questionnaire/questionnaire?id=`+id.split("=")[2],
url: `/pages/questionnaire/questionnaire?id=` + id.split("=")[2],
})
}else if (type == 'ra'){
} else if (type == 'ra') {
tt.navigateTo({
url: `/pages/radetail/index?id=`+id.split("=")[2],
url: `/pages/radetail/index?id=` + id.split("=")[2],
})
}
}else if(e.currentTarget.dataset.data.type==2){
} else if (e.currentTarget.dataset.data.type == 2) {
// 自由图文
tt.navigateTo({
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}`
});
}else if(e.currentTarget.dataset.data.type==4){
} else if (e.currentTarget.dataset.data.type == 4) {
tt.navigateToMiniProgram({
appId: e.currentTarget.dataset.data.goAppid,
// path: 'page/index/index?id=123',
@@ -68,11 +69,10 @@ Component({
// 打开成功
}
})
}
else{
} else {
// 固定格式
tt.navigateTo({
url: `/pages/bannerdetail/bannerdetail?id=${e.currentTarget.dataset.id}`
url: `/pages/bannerdetail/bannerdetail?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.data.tenantId}`
});
}
},
@@ -84,10 +84,10 @@ Component({
},
attached: function () {
// 在组件实例进入页面节点树时执行
if (app.globalData.mouldType){
if (app.globalData.mouldType) {
this.setData({
mouldType: app.globalData.mouldType
})
}
},
});
});

+ 4
- 1
components/coupons/index.js 查看文件

@@ -28,13 +28,16 @@ Component({
},
methods: {
gotoDetail(e) {

console.log(e, 'e');
let couponId = e.currentTarget.dataset.couponid;
let title = e.currentTarget.dataset.title;
let id = e.currentTarget.dataset.id;
let targetAd = e.currentTarget.dataset.targetad;
let mallTenantId = e.currentTarget.dataset.malltenantid;
if (id && targetAd != 7) {
tt.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`,
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}&mallTenantId=${mallTenantId}`,
})
} else if (targetAd == 7) {
tt.navigateTo({


+ 9
- 7
components/coupons/index.ttml 查看文件

@@ -1,5 +1,5 @@
<view class='navigator' bindtap='gotoDetail' data-id='{{data.id}}' data-targetAd='{{data.targetAd}}' hover-class='hover'
data-couponId='{{data.couponId}}' data-title='{{data.title}}'>
data-couponId='{{data.couponId}}' data-title='{{data.title}}' data-malltenantid='{{data.tenantId}}'>
<view class="presell" tt:if="{{data.type==10}}" style="{{mouldType==1?'top: 280rpx;':''}}">预售 </view>
<!-- 首页优惠券列表页面 -->
<view class="coupons">
@@ -23,8 +23,8 @@
<view class="coupons-info-name tit">{{data.title}}</view>
<view class="coupons-info-name subtitle">{{data.subTitle}}</view>
<view class="coupons-info-price-p">
<view class='price' tt:if="{{data.type!=10&&mouldType==1}}">
<view class="fuhaoX"> ¥{{data.salePriceStr}}</view>
<view class='price' tt:if="{{data.type!=10&&mouldType==1}}">
<view class="fuhaoX"> ¥{{data.salePriceStr}}</view>
</view>
<view class='price' tt:if="{{data.type!=10&&mouldType!=1}}">
<text tt:if="{{data.targetAd == 101||data.targetAd == 5}}"><text class='rmb'>¥</text>
@@ -61,8 +61,9 @@

<view class="coupons-btn" tt:if="{{mouldType!=1}}">
<!-- 优惠券价格 -->
<i-button i-class=" coupons-btn-gm" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}"
data-date='{{data}}'>免费领</i-button>
<i-button i-class=" coupons-btn-gm"
tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" data-date='{{data}}'>免费领
</i-button>
<i-button i-class="coupons-btn-gm"
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}"
data-date='{{data}}'>购买</i-button>
@@ -79,8 +80,9 @@

<view class="coupons-btn" tt:if="{{mouldType==1}}">
<!-- 优惠券价格 -->
<i-button i-class=" coupons-btn-gmX" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}"
data-date='{{data}}'>免费领</i-button>
<i-button i-class=" coupons-btn-gmX"
tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" data-date='{{data}}'>免费领
</i-button>
<i-button i-class="coupons-btn-gmX"
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}"
data-date='{{data}}'>购买</i-button>


+ 14
- 13
components/optimization/optimization.js 查看文件

@@ -4,9 +4,9 @@ Component({
* 组件的属性列表
*/
properties: {
businessList:{
type:Array,
value:[]
businessList: {
type: Array,
value: []
},
businessData: {
type: Array,
@@ -18,39 +18,40 @@ Component({
* 组件的初始数据
*/
data: {
classIndex:0
classIndex: 0
},

/**
* 组件的方法列表
*/
methods: {
goDetail(e){
goDetail(e) {
let couponChannelId = e.currentTarget.dataset.id
let couponId = e.currentTarget.dataset.couponid
let mallTenantId = e.currentTarget.dataset.malltenantid
tt.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&mallTenantId=${mallTenantId}`,
})
},
setIndex(e){
setIndex(e) {
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
this.triggerEvent('businessid',id)
this.triggerEvent('businessid', id)
this.setData({
classIndex:index
classIndex: index
})
},
goLsit(){
goLsit() {
tt.navigateTo({
url: '/pages/liveLsit/liveLsit',
success: (res) => {
},
fail: (res) => {
},
});
}

}
})
})

+ 39
- 35
components/optimization/optimization.ttml 查看文件

@@ -1,31 +1,34 @@
<view class="optimizationBox">
<view class="titleImg">
<view class="textl f">优选好物</view>
<view class="textr r">Preferred Good</view>
</view>

<view class="classifyBox-go-box">
<view class="classifyBox">
<view class="itemBox" tt:for="{{businessList}}" tt:key="{{index}}" bindtap="setIndex" data-index="{{index}}" data-id="{{item.id}}">
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view>
<view class="xian" tt:if="{{classIndex==index}}"></view>
</view>
<!-- <view class="titleImg">
<view class="textl f">优选好券</view>
<view class="textr r">Preferred Good</view>
</view> -->

<view class="titleImgNew">
<view class="textl2 f">优选好券</view>
</view>

<view class="classifyBox-go-box">
<view class="classifyBox">
<view class="itemBox" tt:for="{{businessList}}" tt:key="{{index}}" bindtap="setIndex" data-index="{{index}}"
data-id="{{item.id}}">
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view>
<view class="xian" tt:if="{{classIndex==index}}"></view>
</view>
<!-- <view class="goLsit" bindtap="goLsit"> 直播商品 <image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image></view> -->
</view>
<view class="contBox">
<view class="contLsitBox">
<view class="item" tt:for="{{businessData}}" tt:key="{{index}}" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}">
<view class="itemImg">
<image src="{{item.coverImg}}" mode='scaleToFill'></image>
</view>
<view class="titleName">{{item.title}}</view>
<!-- <view class="goLsit" bindtap="goLsit"> 直播商品 <image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image></view> -->
</view>

<view class="contBox">
<view class="contLsitBox">
<view class="item" tt:for="{{businessData}}" tt:key="{{index}}" bindtap="goDetail"
data-couponid="{{item.couponId}}" data-id="{{item.id}}" data-malltenantid="{{item.tenantId}}">
<view class="itemImg">
<image src="{{item.coverImg}}" mode='scaleToFill'></image>
</view>
<view class="titleName">{{item.title}}</view>

<!-- <view class="priceBox">
<!-- <view class="priceBox">
<view class="sellingBox f">
<view class="fuhao">¥</view>
<view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view>
@@ -37,19 +40,20 @@
</view>
</view> -->

<view class="priceBox">
<view class="sellingBox f">
<view class="priceBox">
<view class="sellingBox f">

<view class="fuhaoX">¥{{item.salePriceStr?item.salePriceStr:""}} </view>

<view class="fuhaoX">¥{{item.salePriceStr?item.salePriceStr:""}} </view>
</view>
<view class="r btn">马上抢</view>
</view>
<view class="sellout" tt:if="{{item.remainInventory==0}}">
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image>
</view>
<view class="r btn">马上抢</view>
</view>

<view class="sellout" tt:if="{{item.remainInventory==0}}">
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png">
</image>
</view>
</view>
</view>
</view>
</view>
</view>

+ 287
- 246
components/optimization/optimization.ttss 查看文件

@@ -1,247 +1,288 @@
.optimizationBox {
/* overflow: hidden; */
margin-top: 20rpx;
margin-bottom: 100rpx;
}
.titleImg {
width: 96%;
height: 80rpx;
margin: 0rpx auto;
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_ggw_yxhw.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.textl {
font-size: 34rpx;
font-family: OPPOSans;
font-weight: bold;
color: #dfbe99;
margin: 20rpx;
}
.textr {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 300;
color: #91897e;
margin: 20rpx;
}
.f {
float: left;
}
.r {
float: right;
}
.classifyBox-go-box{

background-color: #fff;
}

.classifyBox {
width: 100%;
border-radius: 20rpx 20rpx 0 0;
background-color: #fff;
overflow: hidden;
display: -webkit-box;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
/* margin: 10rpx 0; *//* background: linear-gradient(0deg, #F5F5F5, #fff); */
float: left;
}
.goLsit{
width: 20%;
float: left;
font-size: 28rpx;
color: #454340;
margin: 20rpx 0 10rpx 0;
}
.classifyBox::-webkit-scrollbar {
display: none;
}
.rup{
width: 13rpx;
height: 20rpx;
margin: 2rpx 0 0 6rpx;
}
.itemBox {
width: 100rpx;
height: 100rpx;
margin: 0 20rpx;
}
.className {
font-size: 28rpx;
font-family: OPPOSans;
font-weight: 500;
color: #454340;
text-align: center;
margin: 20rpx auto 10rpx auto;
}
.className_a {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 800;
color: #c99f67;
text-align: center;
background: linear-gradient(180deg, #cc9a60 0%, #dfbf8e 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin: 20rpx auto 10rpx auto;
}
.xian{
width: 22rpx;
height: 5rpx;
background: linear-gradient(180deg, #D5A56E, #E9D0AA);
border-radius: 3px;
margin: 0 auto;
}
.contBox{
background: linear-gradient(0deg, #F5F5F5, rgba(255, 255, 255, 0.5));
/* height: 350rpx; */
}
.contLsitBox{
width: 96%;
margin: 0 auto;
display: flex;
overflow: hidden;
justify-content: space-between;
flex-wrap: wrap;
}
.item{
width: 49%;
background-color: #fff;
border-radius: 20rpx;
margin: 12rpx 0;
position: relative;
}
.itemImg{
width: 100%;
height: 350rpx;
border-radius: 20rpx;
/* background-color: aquamarine; */
}
.itemImg image{
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}
.titleName{
color: #402e1e;
font-size: 30rpx;
font-family: "PingFangSC-Regular";
font-weight: 400;
width: 100%;
font-size: 28rpx;

width:90%;
height: 80rpx;
font-size: 28rpx;
/* font-family: OPPOSans; */
/* font-weight: 500; */
/* color: #333333; */
margin: 10rpx auto 0 auto;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space:normal;
}
.priceBox{
width: 90%;
overflow: hidden;
margin: 10rpx auto;
}
.f{
float: left;
}
.r{
float:right;
}
.sellingBox{
overflow: hidden
}
.fuhao{
color: #DF2D2D;
font-size: 24rpx;
float: left;
font-family: OPPOSans;
/* font-weight: bold; */
margin-top: 10rpx
}
.fuhaoX{
color: #d5af67;
font-family: "PingFangSC-Medium";
font-size: 34rpx;
font-weight: 400;
float: left;

margin-top: 5rpx
}
.btn{
width: 136rpx;
height: 52rpx;
border-radius: 26rpx;
line-height: 52rpx;
background: linear-gradient(90deg, #E3BA79, #BC8D3E);
text-align: center;
color: #feffff;
font-family: "PingFangSC-Regular";
font-size: 28rpx;
font-weight: 400;
}
.int{
float: left;
font-size: 36rpx;
font-family: OPPOSans;
font-weight: bold;
color: #DF2D2D;
}
.originalBox{
overflow: hidden
}
.origina{
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;
text-decoration: line-through;
color: #999999;
margin-top: 10rpx;
margin-right: 10rpx;
}
.priceNum{
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;
color: #999999;
margin-top: 10rpx;
/* margin-right: 10rpx; */
}
.sellout{
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
border-radius: 20rpx;
}
.selloutImg{
width: 195rpx !important;
height: 154rpx !important;
margin: 50% auto;
display: block
}
/* overflow: hidden; */
margin-top: 20rpx;
margin-bottom: 100rpx;
}

.titleImg {
width: 96%;
height: 80rpx;
margin: 0rpx auto;
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_ggw_yxhw.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}

.titleImgNew {
width: 96%;
height: 80rpx;
margin: 0rpx auto;
border-bottom: 2px solid #525252;
background-size: 100% 100%;
background-repeat: no-repeat;
}

.textl {
font-size: 34rpx;
font-family: OPPOSans;
font-weight: bold;
color: #dfbe99;
margin: 20rpx;
}

.textl2 {
font-size: 40rpx;
font-family: OPPOSans;
font-weight: bold;
color: #525252;
margin: 20rpx;
}

.textr {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 300;
color: #91897e;
margin: 20rpx;
}

.f {
float: left;
}

.r {
float: right;
}

.classifyBox-go-box {

/* background-color: #fff; */
}

.classifyBox {
width: 100%;
border-radius: 20rpx 20rpx 0 0;
/* background-color: #fff; */
overflow: hidden;
display: -webkit-box;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
/* margin: 10rpx 0; */
/* background: linear-gradient(0deg, #F5F5F5, #fff); */
float: left;
}

.goLsit {
width: 20%;
float: left;
font-size: 28rpx;
color: #454340;
margin: 20rpx 0 10rpx 0;
}

.classifyBox::-webkit-scrollbar {
display: none;
}

.rup {
width: 13rpx;
height: 20rpx;
margin: 2rpx 0 0 6rpx;
}

.itemBox {
width: 100rpx;
height: 100rpx;
margin: 0 20rpx;
}

.className {
font-size: 28rpx;
font-family: OPPOSans;
font-weight: 500;
color: #454340;
text-align: center;
margin: 20rpx auto 10rpx auto;
}

.className_a {
font-size: 30rpx;
font-family: OPPOSans;
font-weight: 800;
color: #c99f67;
text-align: center;
background: linear-gradient(180deg, #cc9a60 0%, #dfbf8e 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin: 20rpx auto 10rpx auto;
}

.xian {
width: 22rpx;
height: 5rpx;
background: linear-gradient(180deg, #D5A56E, #E9D0AA);
border-radius: 3px;
margin: 0 auto;
}

.contBox {
background: linear-gradient(0deg, #F5F5F5, rgba(255, 255, 255, 0.5));
/* height: 350rpx; */
}

.contLsitBox {
width: 96%;
margin: 0 auto;
display: flex;
overflow: hidden;
justify-content: space-between;
flex-wrap: wrap;

}

.item {
width: 49%;
background-color: #fff;
border-radius: 20rpx;
margin: 12rpx 0;
position: relative;
}

.itemImg {
width: 100%;
height: 350rpx;
border-radius: 20rpx;
/* background-color: aquamarine; */
}

.itemImg image {
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}

.titleName {
color: #402e1e;
font-size: 30rpx;
font-family: "PingFangSC-Regular";
font-weight: 400;
width: 100%;
font-size: 28rpx;

width: 90%;
height: 80rpx;
font-size: 28rpx;
/* font-family: OPPOSans; */
/* font-weight: 500; */
/* color: #333333; */
margin: 10rpx auto 0 auto;

overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;

}

.priceBox {
width: 90%;
overflow: hidden;
margin: 10rpx auto;
}

.f {
float: left;
}

.r {
float: right;
}

.sellingBox {
overflow: hidden
}

.fuhao {
color: #DF2D2D;
font-size: 24rpx;
float: left;
font-family: OPPOSans;
/* font-weight: bold; */
margin-top: 10rpx
}

.fuhaoX {
color: #d5af67;
font-family: "PingFangSC-Medium";
font-size: 34rpx;
font-weight: 400;
float: left;

margin-top: 5rpx
}

.btn {
width: 136rpx;
height: 52rpx;
border-radius: 26rpx;
line-height: 52rpx;
background: linear-gradient(90deg, #E3BA79, #BC8D3E);
text-align: center;
color: #feffff;
font-family: "PingFangSC-Regular";
font-size: 28rpx;
font-weight: 400;
}

.int {
float: left;
font-size: 36rpx;
font-family: OPPOSans;
font-weight: bold;
color: #DF2D2D;
}

.originalBox {
overflow: hidden
}

.origina {
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;
text-decoration: line-through;
color: #999999;
margin-top: 10rpx;
margin-right: 10rpx;
}

.priceNum {
text-align: right;
font-size: 24rpx;
font-family: OPPOSans;
font-weight: 400;

color: #999999;
margin-top: 10rpx;
/* margin-right: 10rpx; */
}

.sellout {
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
border-radius: 20rpx;
}

.selloutImg {
width: 195rpx !important;
height: 154rpx !important;
margin: 50% auto;
display: block
}

+ 101
- 0
components/shop/shop.js 查看文件

@@ -0,0 +1,101 @@
const imgurl = require("../../utils/imgurl");

Component({
properties: {
mallList: {
value: [],
type: Array
}
},

data: {
telJpgUrl: imgurl.teljpg.url,
list: [], // 广场、商户列表
mallNum: 0, // 适用商户数量
},

methods: {
// 跳转详情页
gotoDetail(e) {
console.log(e);
tt.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${e.currentTarget.dataset.tenantid}`
})
},

// 跳转资质页面
goCertification(e) {
tt.navigateTo({
url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
})
},

//跳转地图页面
goMap(e) {
let {
latitude,
longitude
} = e.currentTarget.dataset.item
console.log(latitude, longitude);
tt.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
scale: 18,
success() {
console.log("打开地图成功");
},
fail(err) {
console.log("打开地图失败:", err.errMsg);
},
});
},

goFitShop() {
const arr = []
this.data.list.forEach(item => {
item.merchantVoList.forEach(el => {
arr.push(el)
})
})
tt.navigateTo({
url: `/pages/fitShop/fitShop?list=${JSON.stringify(arr)}`,
success: (res) => {},
fail: (res) => {},
});
},

expandList(e) {
const index = e.currentTarget.dataset.index
const arr = this.data.list
arr[index].expand = !arr[index].expand
this.setData({
list: arr
})
},

phone(e) {
tt.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
});
},
},

ready() {
this.setData({
list: JSON.parse(JSON.stringify(this.properties.mallList))
})

console.log(this.data.mallList, 'mallList');
let mallNum = 0
this.data.list.forEach(item => {
mallNum += item.merchantVoList.length
})
this.setData({
mallNum: mallNum
})
},

created() {

}
})

+ 3
- 0
components/shop/shop.json 查看文件

@@ -0,0 +1,3 @@
{
"component": true
}

+ 230
- 0
components/shop/shop.less 查看文件

@@ -0,0 +1,230 @@
.components {
display: block;
height: auto;
margin-top: 15rpx;
margin-bottom: 15rpx;
background-color: #fff;

.header {
height: 70rpx;

.applyshop {
float: left;
font-size: 30rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
font-weight: bold;
}

.goShop {
float: left;
font-size: 22rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #a6a6a6;
background: #fff;
font-weight: bold;
margin-right: 25rpx;
}

.rightArrow {
float: right;
display: block;
width: 14rpx;
margin: 24rpx 30rpx 0 10rpx;
}
}

.body {
// border-bottom: 10rpx solid #f4f5f9;

.mall {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15rpx;
// margin-bottom: 15rpx;
padding-left: 25rpx;
padding-right: 65rpx;

.img {
display: inline-block;
width: 75rpx;
height: 75rpx;
}

.mallItem {
position: relative;
top: -26rpx;
display: inline-block;
margin-left: 25rpx;

.title {
font-size: 28rpx;
}
}

.goExpand {
font-size: 25rpx;
color: #a6a6a6;

.text {
display: inline-block;
margin-right: 20rpx;
}

.rightArrowDown {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(90deg);
}

.rightArrowUp {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(-90deg);
}
}
}



.shop {
.posi {
/* position: relative; */
width: 100%;
background: #FFF;
margin-bottom: 5rpx;

.posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;

view {
&:nth-child(1) {
image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}
}
}

.name {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 400rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.shopVoList {
white-space: nowrap !important;
overflow-y: scroll;
height: 60rpx !important;
width: 360rpx;
font-size: 16px;
color: #333;
letter-spacing: 0;

text {
font-size: 20rpx !important;
color: #b8b8b8 !important;
}
}

.telBox {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;

.telImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
}

.certificationBox {
position: absolute;
right: 80rpx;
top: 0;
bottom: 0;
// margin: auto;

.certificationImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}

.telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
}
}

.siteBox {
overflow: hidden;
width: 92%;
margin: 0 auto 1rpx auto;
padding-bottom: 10rpx;

.siteText {
width: 90%;
float: left;
font-size: 24rpx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.siteImg {
float: right;
width: 40rpx;
height: 40rpx;
}
}

.dividerInside {
width: 100%;
height: 5rpx;
background-color: #DCDFE6;
}
}
}

.divider {
width: 100%;
height: 12rpx;
background-color: #f4f5f9;
}
}
}

+ 64
- 0
components/shop/shop.ttml 查看文件

@@ -0,0 +1,64 @@
<view class="components">
<view class="header">
<view class='applyshop'>{{"适用门店("+mallNum+"家)"}}</view>
<!-- <image src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrow">
</image> -->
<!-- <view class="goShop">{{'共'+mallNum+'家门店适用'}}</view> -->
</view>
<view tt:for="{{list}}" tt:for-index="index" tt:key="index" class="body">
<view class="mall">
<view>
<image class="img" src="../../assets/itemImg/merchantImgCover.png"></image>
<view class="mallItem">
<view class="title">{{item.mallName}}</view>
</view>
</view>
<!-- 当商户数量不大于三个时 -->
<view class="goExpand" catchtap="expandList" data-index="{{index}}">
<view>
<text class="text">{{item.merchantVoList.length+'家门店适用'}}</text>
<image tt:if="{{!item.expand}}" src="../../assets/itemImg/chevron.png" mode="widthFix"
class="rightArrowDown">
</image>
<image tt:else src="../../assets/itemImg/chevron.png" mode="widthFix" class="rightArrowUp"></image>
</view>
</view>
</view>

<!-- 当item.expand为true且商户数量不大于三个时 -->
<view class="shop" tt:if="{{item.expand}}">
<view class='posi' tt:for="{{item.merchantVoList}}" tt:for-index="itemIndex" tt:key="{{itemIndex}}">
<view class='posi_logo'>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<image src='{{item.merchantImgUrl}}'></image>
</view>
<view bindtap='gotoDetail' data-id='{{item.id}}' data-tenantId='{{item.tenantId}}'>
<view class='name'>{{item.merchantName}}</view>
<view class='shopVoList'>
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName">
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text>
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text>
</view>
</view>
</view>
<view class="telBox" tt:if="{{item.linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg"
src="{{telJpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification"
data-id="{{item.id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}">
<view class="siteText">{{item.addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>
<view class="dividerInside" tt:if="{{(itemIndex+1)<list[index].merchantVoList.length}}"></view>
</view>
</view>
<view class="divider" tt:if="{{(index+1)<list.length}}"></view>
</view>
</view>

+ 187
- 0
components/shop/shop.ttss 查看文件

@@ -0,0 +1,187 @@
.components {
display: block;
height: auto;
margin-top: 15rpx;
margin-bottom: 15rpx;
background-color: #fff;
}
.components .header {
height: 70rpx;
}
.components .header .applyshop {
float: left;
font-size: 30rpx;
line-height: 70rpx;
text-indent: 1em;
color: #333;
background: #fff;
font-weight: bold;
}
.components .header .goShop {
float: left;
font-size: 22rpx;
height: 70rpx;
line-height: 70rpx;
text-indent: 1em;
color: #a6a6a6;
background: #fff;
font-weight: bold;
margin-right: 25rpx;
}
.components .header .rightArrow {
float: right;
display: block;
width: 14rpx;
margin: 24rpx 30rpx 0 10rpx;
}
.components .body .mall {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15rpx;
padding-left: 25rpx;
padding-right: 65rpx;
}
.components .body .mall .img {
display: inline-block;
width: 75rpx;
height: 75rpx;
}
.components .body .mall .mallItem {
position: relative;
top: -26rpx;
display: inline-block;
margin-left: 25rpx;
}
.components .body .mall .mallItem .title {
font-size: 28rpx;
}
.components .body .mall .goExpand {
font-size: 25rpx;
color: #a6a6a6;
}
.components .body .mall .goExpand .text {
display: inline-block;
margin-right: 20rpx;
}
.components .body .mall .goExpand .rightArrowDown {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(90deg);
}
.components .body .mall .goExpand .rightArrowUp {
display: inline-block;
position: relative;
top: 5rpx;
width: 14rpx;
transform: rotate(-90deg);
}
.components .body .shop .posi {
/* position: relative; */
width: 100%;
background: #FFF;
margin-bottom: 5rpx;
}
.components .body .shop .posi .posi_logo {
position: relative;
width: 92%;
display: flex;
padding: 20rpx 0;
background: #fff;
margin: 0 auto;
}
.components .body .shop .posi .posi_logo view:nth-child(1) image {
display: block;
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
margin-right: 16rpx;
border: 1px solid #e5e5e5;
}
.components .body .shop .posi .posi_logo .name {
font-size: 32rpx;
color: #333;
letter-spacing: 0;
width: 400rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.components .body .shop .posi .posi_logo .shopVoList {
white-space: nowrap !important;
overflow-y: scroll;
height: 60rpx !important;
width: 360rpx;
font-size: 16px;
color: #333;
letter-spacing: 0;
}
.components .body .shop .posi .posi_logo .shopVoList text {
font-size: 20rpx !important;
color: #b8b8b8 !important;
}
.components .body .shop .posi .posi_logo .telBox {
position: absolute;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
.components .body .shop .posi .posi_logo .telBox .telImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}
.components .body .shop .posi .posi_logo .telBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
.components .body .shop .posi .posi_logo .certificationBox {
position: absolute;
right: 80rpx;
top: 0;
bottom: 0;
}
.components .body .shop .posi .posi_logo .certificationBox .certificationImg {
width: 50rpx;
height: 50rpx;
margin-top: 20rpx;
}
.components .body .shop .posi .posi_logo .certificationBox .telText {
text-align: center;
color: #b8b8b8 !important;
font-size: 20rpx;
}
.components .body .shop .posi .siteBox {
overflow: hidden;
width: 92%;
margin: 0 auto 1rpx auto;
padding-bottom: 10rpx;
}
.components .body .shop .posi .siteBox .siteText {
width: 90%;
float: left;
font-size: 24rpx;
color: #333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.components .body .shop .posi .siteBox .siteImg {
float: right;
width: 40rpx;
height: 40rpx;
}
.components .body .shop .posi .dividerInside {
width: 100%;
height: 5rpx;
background-color: #DCDFE6;
}
.components .body .divider {
width: 100%;
height: 12rpx;
background-color: #f4f5f9;
}

+ 24
- 23
components/store/index.js 查看文件

@@ -15,47 +15,49 @@ Component({
*/
data: {
teljpgUrl: imgurl.teljpg.url,
showMore:false,
showMore: false,
more: "点击查看更多",
hidden:"hidden",
hidden: "hidden",
height: ""
},
/**
* 组件的方法列表
*/
methods: {
/**
* 跳转到门店列表的详情页面
*/
* 跳转到门店列表的详情页面
*/
gotoDetail(e) {
tt.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
})
},
goCertification(e){
goCertification(e) {
tt.navigateTo({
url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
})
},
goFitShop(){
goFitShop() {
tt.navigateTo({
url: `/pages/fitShop/fitShop?list=${JSON.stringify(this.data.merchantVoList)}`,
success: (res) => {
success: (res) => {
},
fail: (res) => {
},
});
},
goMap(e){

let {latitude,longitude} = e.currentTarget.dataset.item
console.log(latitude,longitude);
goMap(e) {
let {
latitude,
longitude
} = e.currentTarget.dataset.item
console.log(latitude, longitude);
tt.openLocation({
latitude:Number(latitude),
longitude:Number(longitude),
latitude: Number(latitude),
longitude: Number(longitude),
scale: 18,
success() {
console.log("打开地图成功");
@@ -64,11 +66,10 @@ Component({
console.log("打开地图失败:", err.errMsg);
},
});

},
// 点击查看更多
more: function () {
console.log(this.properties.merchantVoList,"merchantVoList");
console.log(this.properties.merchantVoList, "merchantVoList");
let that = this;
if (that.data.more == '点击查看更多') {
this.setData({
@@ -92,17 +93,17 @@ Component({
phoneNumber: e.target.dataset.merchantlinkphone
});
},
},
ready: function () {
let merchantVoList = this.properties.merchantVoList;
if (merchantVoList.length>0){
if (merchantVoList.length > 0) {
if (merchantVoList.length <= 4) {
this.setData({
height: merchantVoList.length * 140 + 'rpx',
showMore: false,
hidden:"hidden"
hidden: "hidden"
})
} else if (merchantVoList && merchantVoList.length > 4) {
this.setData({
@@ -111,4 +112,4 @@ Component({
}
}
}
});
});

+ 9
- 7
components/store/index.ttml 查看文件

@@ -1,10 +1,9 @@

<view class="applyshopBox" bindtap="goFitShop">
<view class='applyshop'>适用门店</view>
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/chevron.png" mode="widthFix" class="genduoImg">
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/chevron.png" mode="widthFix" class="genduoImg">
</image>
<view class="goShop">{{merchantVoList.length+'家店适用'}}</view>
</view>
<!-- style='overflow:{{hidden}};height:{{height}}' -->
<view class='posi'>
@@ -22,15 +21,18 @@
</view>
</view>
<view class="telBox" tt:if="{{merchantVoList[0].linkLinePhone}}">
<image bindtap='phone' data-merchantLinkPhone='{{merchantVoList[0].linkLinePhone}}' class="telImg" src="{{teljpgUrl}}" mode="widthFix" />
<image bindtap='phone' data-merchantLinkPhone='{{merchantVoList[0].linkLinePhone}}' class="telImg"
src="{{teljpgUrl}}" mode="widthFix" />
<view class="telText">电话</view>
</view>
<view class="certificationBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goCertification" data-id="{{merchantVoList[0].id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="certificationBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}"
bindtap="goCertification" data-id="{{merchantVoList[0].id}}">
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" />
<view class="telText">资质</view>
</view>
</view>
<view class="siteBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goMap" data-item="{{merchantVoList[0]}}">
<view class="siteBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goMap"
data-item="{{merchantVoList[0]}}">
<view class="siteText">{{merchantVoList[0].addr}}</view>
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" />
</view>


+ 12
- 13
components/tabbar/tabbar.js 查看文件

@@ -7,8 +7,7 @@ Component({
selected: null,
"color": "#abb1be",
"selectedColor": "#6c5535",
list: [
{
list: [{
"pagePath": "/index/index",
"text": "首页",
"iconPath": "../../assets/images/home.png",
@@ -33,7 +32,7 @@ Component({
"selectedIconPath": "../../assets/images/user_a.png"
}
],
},
properties: {

@@ -53,15 +52,15 @@ Component({
},
methods: {
navigateTo(e) {
// this.setData({
// list: this.data.home_a_img
// })
// console.log(this.data.home_a_img)

const data = e.currentTarget.dataset;
if(app.globalData.selected==data.index){
if (app.globalData.selected == data.index) {
return
}
// tt.hideLoading();
@@ -69,16 +68,16 @@ Component({
title: "加载中"
});
app.globalData.selected = data.index
console.log(app.globalData.selected);
const url = data.path;
if (data.index == 0 || data.index == 3) {
this.setWxMessage()
}
if(data.index == 2){
app.globalData.ifshowtab=true
}else{
app.globalData.ifshowtab=false
if (data.index == 2) {
app.globalData.ifshowtab = true
} else {
app.globalData.ifshowtab = false
}
// tt.reLaunch({
// url
@@ -119,7 +118,7 @@ Component({
// })
// },
setWxMessage() {
if(app.globalData.templateId.length<0)return
if (app.globalData.templateId && app.globalData.templateId.length < 0) return
console.log(app.globalData.templateId);
let tmplIds = []
app.globalData.templateId.map(res => {
@@ -128,7 +127,7 @@ Component({
tt.requestSubscribeMessage({
tmplIds: tmplIds,
success(res) {
console.log("我重复订阅",res)
console.log("我重复订阅", res)
let _statue = null
tmplIds.map((item, index) => { //判读用户是否点击了确定
if (res[item] == "accept") {


+ 10
- 19
ext.json 查看文件

@@ -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": "tt620e14b3fd30264101"
},
"window": {
"backgroundTextStyle": "light",
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#fff"
},
"extAppid": "tt620e14b3fd30264101",
"extEnable": true,
"directCommit": false,
"networkTimeout": {
"request": 30000,
"downloadFile": 10000
}
}

+ 560
- 278
index/index.js
文件差异内容过多而无法显示
查看文件


+ 16
- 18
index/index.json 查看文件

@@ -1,19 +1,17 @@
{
"usingComponents": {
"c-banner": "../components/banner/index",
"c-coupons": "../pages/main/coupons/index",
"c-hot": "../components/hot/hot",
"c-advertisement":"../components/advertisement/advertisement",
"navbar": "../components/navbar/navbar",
"c-mould":"../components/commodityMould/commodityMould",
"optimization":"../components/optimization/optimization",
"tabbar":"../components/tabbar/tabbar"
},
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "首页"
{
"usingComponents": {
"c-banner": "../components/banner/index",
"c-coupons": "../pages/main/coupons/index",
"c-hot": "../components/hot/hot",
"c-advertisement": "../components/advertisement/advertisement",
"navbar": "../components/navbar/navbar",
"c-mould": "../components/commodityMould/commodityMould",
"optimization": "../components/optimization/optimization",
"tabbar": "../components/tabbar/tabbar"
},
"enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "首页"

}
}

+ 52
- 145
index/index.ttml 查看文件

@@ -1,147 +1,53 @@
<!-- 初始模板 -->
<view tt:if="{{mouldType==0}}">
<!-- <navbar color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="首页"></navbar> -->
<!-- style="padding-top:{{navigationBarHeight}}" -->
<view class="container">
<!-- <view style="height:{{navigationBarHeight1}} "></view> -->
<!-- 会员信息 -->
<view class="color_box" style="{{typeLsit.sy_bbg.styleClass}}">
<!-- 所属集团 -->
<view class="underling" bindtap="goSquareList" tt:if="{{squareName}}">
<image class="underlingImg" mode="widthFix" src="https://formall.oss-accelerate.aliyuncs.com/cimg/dingwei.png">
</image>
<view class="underlingName">{{squareName}} ↓</view>
</view>
<view class='userinfo' tt:if="{{ifStoreApp!=1}}">
<!-- 头像 -->
<view class='infoLeft' style="{{typeLsit.sy_xxb.styleClass}}">
<view class="user-avatar">
<open-data class="open" type="userAvatarUrl"></open-data>
</view>
<!-- 成长值 -->
<view class="user-data fl" bindtap='gotoChengzhangzhi' style="{{typeLsit.sy_xxb.styleClass}}">
<view class='nameBox'>
<open-data type="userNickName" style="{{typeLsit.sy_xxb_nf.styleClass}}"></open-data>
<view class='chengzhangBox' style='background:{{chengzhangBox}}'>
<text class='chengzhang'>{{levelName}}</text>
</view>
</view>
<view class="view">
<progress percent="{{upgradePercent}}" stroke-width="6" activeColor="{{activeColor}}" />
<view class='remainchengzhangzhi' style="{{typeLsit.sy_xxb_cf.styleClass}}">还需{{upgradeScore}}成长值可升级
</view>
</view>
</view>
</view>

<!-- 二维码 -->
<view class='qrcode fr' bindtap='qrcode' style="{{typeLsit.sy_qrc.styleClass}}">
<image src="{{typeLsit.sy_qrc.icon}}" class='qrcodeimg' mode='widthFix'></image>
</view>
</view>
<!-- banner -->
<c-banner tt:key="unique" list="{{list}}" />
<!-- 频道 -->
<view class="channelBox" tt:if="{{ifStoreApp!=1&&moduleList.length>0}}" style="{{typeLsit.sy_mbg.styleClass}}">
<view class='kjBox' bindtap='goPage' data-obj="{{item}}" tt:for="{{moduleList}}" tt:key="{{index}}">
<image src='{{item.icon}}' mode='aspectFill'></image>
<view class="text">{{item.name}}</view>
</view>
</view>

<view class='channelBox' tt:if="{{ifStoreApp==1}}" style="width:525rpx;">
<view class='kjBox' bindtap='gotoBargain'>
<image src='{{kanjia}}' mode='aspectFill'></image>
<text>砍价</text>
</view>
<view class='kjBox' bindtap='gotoSpellGroup'>
<image src='{{pintuan}}' mode='aspectFill'></image>
<text>拼团</text>
</view>
<view class='kjBox' bindtap='gotoRushBuy'>
<image src='{{xiaofeika}}' mode='aspectFill'></image>
<text>限时抢购</text>
</view>
</view>

</view>
<view class='toutiao1' tt:if="{{showQg&&ifStoreApp!=1}}">
<view class='xianshi' bindtap='gotoRushBuy'>
<text>限时专区</text>
<text>限时惊爆价 轻松拎回家</text>
</view>
<view class='xsCon'>
<view tt:for="{{xslist}}" tt:key="index">
<view class='igBox' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}"
data-targetAd="{{item.targetAd}}" bindtap='gotodetail'>
<image src='{{xslist[index].coverImg}}' mode='widthFix' class='imageH'></image>
<view class='imTit'>{{xslist[index].title}}</view>
</view>
</view>
<view>
<view class='igBox' bindtap='gotoRushBuy'>
<image src='{{more}}' mode='widthFix' class='more'></image>
<view class='imTit'>更多...</view>
</view>
</view>
</view>
</view>

<!-- 爆款专区 -->
<c-hot id="hot" />
<view class='product' tt:if="{{showTopic}}" bindtap='gotoTopic'>
<image src='{{cover}}' mode='widthFix'></image>
</view>


<c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}"
loading="{{loading}}" />
<!-- 广告蒙层 -->
<c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" />
</view>
<!-- 顶部签到成长值 -->
<view class='signin' tt:if="{{fistLogin}}" animation="{{alphaData}}">
<open-data class="open" type="userAvatarUrl"></open-data>
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text>
</view>
<view class="integralBox" tt:if="{{businessSwitch}}">
<!--是未授权微信且未授权手机号 -->
<navigator url="/pages/getuserinfo/index" open-type="navigate" tt:if="{{accreditFlag==1}}">
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix'
style="width: 100%;height: 100%;"></image>
</navigator>
<!-- 授权了微信 没授权手机号 -->
<navigator url="/pages/getuserinfo/index" open-type="navigate" tt:if="{{accreditFlag==2}}">
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix'
style="width: 100%;height: 100%;"></image>
</navigator>
</view>
</view>


<!-- 欢乐城模板 -->
<view tt:if="{{mouldType==1}}">
<view>
<view class="container1">
<!-- 会员信息 -->

<view class="color_box1">
<view>
<!-- navigationBarHeight -->
<!-- <view style="height:{{navigationBarHeight}};overflow: hidden;" class="goSqunar1" bindtap="goSquareList">
<image class="squareLogo" src="../assets/imgData/squareLogo.png" style="top: {{navImgHeight}};" ></image>
<!-- <view> -->
<!-- navigationBarHeight -->
<!-- <view style="height:{{navigationBarHeight}};overflow: hidden;" class="goSqunar1" bindtap="goSquareList">
<image class="squareLogo" src="../assets/imgData/squareLogo.png" style="top: {{navImgHeight}};"></image>

<view class="title1" style="line-height:{{navLineHeight}}">{{marketName}}</view>
<view tt:if="{{isShowSqare}}" style="height:{{navLineHeight}};position:relative;margin-right: 80rpx">
<image src="{{huanlechengImgurl}}home_ic_xialajt.png" class="xia">
<image src="{{huanlechengImgurl}}home_ic_xialajt.png" class="xia">
</image>
</view>

</view> -->
<!-- </view> -->

<!-- 距离信息的广场列表 -->
<view class="pickerMall" tt:if="{{shopList.length>1 && shopList[0].distanceName}}">
<picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{shopList}}" range-key="name"
disabled="{{false}}">
<view>
<view>
<image src="../assets/images/location.png" class="location"></image>
<text class="mallName">{{ shopList[index].name }}</text>
<!-- <text tt:if="{{shopList[index].distance_str}}" class="distance_str">距您{{
shopList[index].distance_str}}</text> -->
<image src="../assets/itemImg/arrow-right-l.png" class="right"></image>
</view>
</view>
</picker>
</view>



<!-- 仅广场列表不包括距离信息 -->
<view class="pickerMall" tt:if="{{shopList.length>1 && !shopList[0].distanceName}}">
<picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{shopList}}" range-key="name"
disabled="{{false}}">
<view>
<view>
<image src="../assets/images/location.png" class="location"></image>
<text class="mallName">{{ shopList[index].name }}</text>
<text tt:if="{{shopList[index].distance_str}}" class="distance_str">距您{{
shopList[index].distance_str}}</text>
<image src="../assets/itemImg/arrow-right-l.png" class="right"></image>
</view>
</view>
</picker>
</view>

<!-- banner -->
<c-banner tt:key="unique" list="{{list}}" />
@@ -171,22 +77,23 @@


<!-- 限时抢购 -->
<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" />

<!-- <c-mould tt:if="{{topicObj6}}" obj="{{topicObj6}}"
titleImgUrl="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_txt_jfsc.png" /> -->

<optimization tt:if="{{businessList.length>0}}" businessList="{{businessList}}" businessData="{{businessData}}"
bind:businessid="getBusineData" />
@@ -195,7 +102,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}}">
@@ -214,4 +121,4 @@
</view>
</view>
<tabbar />
<s-title/>
<s-title />

+ 50
- 20
index/index.ttss 查看文件

@@ -3,11 +3,13 @@
page {
background: #f4f5f9;
}
.temp{

.temp {
width: 100rpx;
height: 100rpx;
background-color: darkcyan
}

.xia {
width: 24rpx;
height: 14rpx;
@@ -18,7 +20,7 @@ page {
left: 0;
right: 0;
bottom: 0;
/* margin: auto; */
}

@@ -26,9 +28,10 @@ page {
display: flex;
justify-content: space-around;
}

.goSqunar1 {
display: flex;
justify-content: center;
justify-content: center;
background-image: url('https://formall.oss-accelerate.aliyuncs.com/douyin_ifomall/imgData/topback_1.png');
background-size: 100% 100%;
background-repeat: no-repeat;
@@ -36,7 +39,7 @@ page {
height: 190rpx;
}

.squareLogo{
.squareLogo {
width: 94rpx;
height: 40rpx;
position: absolute;
@@ -48,11 +51,11 @@ page {
font-size: 32rpx;
font-family: OPPOSans;
font-weight: bold;
}

.title1 {
max-width:320rpx;
max-width: 320rpx;
color: #402e1e;
font-family: "PingFangSC-Medium";
font-size: 28rpx;
@@ -66,9 +69,9 @@ page {
width: 24rpx;
/* height: 15rpx; */
}
.marketName{

}
.marketName {}

.f {
float: left;
}
@@ -108,16 +111,39 @@ page {
}

.color_box {
/* padding-top: 20rpx; *//* background-image: linear-gradient(#DC143C, #F4F5F9); */
/* padding-top: 20rpx; */
/* background-image: linear-gradient(#DC143C, #F4F5F9); */
background-color: #f4f5f9;
}

.underlingImg {
width: 30rpx;
height: 60rpx;
font-size: 30prx;
float: left;
/* margin-top: 20rpx; */
.pickerMall {
height: auto;
margin: 0 0 15rpx 20rpx;
font-size: 30rpx;
}

.location {
position: relative;
top: 8rpx;
width: 35rpx;
height: 35rpx;
margin-right: 10rpx;
}

/* .mallName {
font-weight: 600;
} */

.distance_str {
margin-left: 10rpx;
}

.right {
position: relative;
top: 6rpx;
left: 10rpx;
width: 35rpx;
height: 35rpx;
}

.underlingName {
@@ -222,18 +248,20 @@ page {
padding: 0 38rpx;
}

.section >view, .sellsection>view {
.section>view,
.sellsection>view {
width: 25%;
display: inline-block;
position: relative;
}

.section >view image, .sellsection>view image {
.section>view image,
.sellsection>view image {
display: block;
margin: 0 auto;
}

.section >view image {
.section>view image {
width: 55rpx;
height: 55rpx;
margin-top: 20rpx;
@@ -604,9 +632,11 @@ page {
text-overflow: ellipsis;
white-space: nowrap;
}
.remainchengzhangzhi p{

.remainchengzhangzhi p {
display: inline;
}

progress {
width: 200rpx;
border-radius: 60rpx;
@@ -838,4 +868,4 @@ i-tabs i-tabs-scroll {
right: 20rpx;
position: fixed;
z-index: 1000000;
}
}

+ 120
- 0
index/indexOld.txt 查看文件

@@ -0,0 +1,120 @@
<!-- 初始模板 -->

<view tt:if="{{mouldType==0}}">
<!-- <navbar color="{{typeLsit.sy_top_f.styleClass}}" background="{{typeLsit.sy_top.styleClass}}" text="首页"></navbar> -->
<!-- style="padding-top:{{navigationBarHeight}}" -->
<view class="container">
<!-- <view style="height:{{navigationBarHeight1}} "></view> -->
<!-- 会员信息 -->
<view class="color_box" style="{{typeLsit.sy_bbg.styleClass}}">
<!-- 所属集团 -->
<view class="underling" bindtap="goSquareList" tt:if="{{squareName}}">
<image class="underlingImg" mode="widthFix" src="https://formall.oss-accelerate.aliyuncs.com/cimg/dingwei.png">
</image>
<view class="underlingName">{{squareName}} ↓</view>
</view>
<view class='userinfo' tt:if="{{ifStoreApp!=1}}">
<!-- 头像 -->
<view class='infoLeft' style="{{typeLsit.sy_xxb.styleClass}}">
<view class="user-avatar">
<open-data class="open" type="userAvatarUrl"></open-data>
</view>
<!-- 成长值 -->
<view class="user-data fl" bindtap='gotoChengzhangzhi' style="{{typeLsit.sy_xxb.styleClass}}">
<view class='nameBox'>
<open-data type="userNickName" style="{{typeLsit.sy_xxb_nf.styleClass}}"></open-data>
<view class='chengzhangBox' style='background:{{chengzhangBox}}'>
<text class='chengzhang'>{{levelName}}</text>
</view>
</view>
<view class="view">
<progress percent="{{upgradePercent}}" stroke-width="6" activeColor="{{activeColor}}" />
<view class='remainchengzhangzhi' style="{{typeLsit.sy_xxb_cf.styleClass}}">还需{{upgradeScore}}成长值可升级
</view>
</view>
</view>
</view>

<!-- 二维码 -->
<view class='qrcode fr' bindtap='qrcode' style="{{typeLsit.sy_qrc.styleClass}}">
<image src="{{typeLsit.sy_qrc.icon}}" class='qrcodeimg' mode='widthFix'></image>
</view>
</view>
<!-- banner -->
<c-banner tt:key="unique" list="{{list}}" />
<!-- 频道 -->
<view class="channelBox" tt:if="{{ifStoreApp!=1&&moduleList.length>0}}" style="{{typeLsit.sy_mbg.styleClass}}">
<view class='kjBox' bindtap='goPage' data-obj="{{item}}" tt:for="{{moduleList}}" tt:key="{{index}}">
<image src='{{item.icon}}' mode='aspectFill'></image>
<view class="text">{{item.name}}</view>
</view>
</view>

<view class='channelBox' tt:if="{{ifStoreApp==1}}" style="width:525rpx;">
<view class='kjBox' bindtap='gotoBargain'>
<image src='{{kanjia}}' mode='aspectFill'></image>
<text>砍价</text>
</view>
<view class='kjBox' bindtap='gotoSpellGroup'>
<image src='{{pintuan}}' mode='aspectFill'></image>
<text>拼团</text>
</view>
<view class='kjBox' bindtap='gotoRushBuy'>
<image src='{{xiaofeika}}' mode='aspectFill'></image>
<text>限时抢购</text>
</view>
</view>

</view>
<view class='toutiao1' tt:if="{{showQg&&ifStoreApp!=1}}">
<view class='xianshi' bindtap='gotoRushBuy'>
<text>限时专区</text>
<text>限时惊爆价 轻松拎回家</text>
</view>
<view class='xsCon'>
<view tt:for="{{xslist}}" tt:key="index">
<view class='igBox' data-couponId="{{item.couponId}}" data-couponChannelId="{{item.id}}"
data-targetAd="{{item.targetAd}}" bindtap='gotodetail'>
<image src='{{xslist[index].coverImg}}' mode='widthFix' class='imageH'></image>
<view class='imTit'>{{xslist[index].title}}</view>
</view>
</view>
<view>
<view class='igBox' bindtap='gotoRushBuy'>
<image src='{{more}}' mode='widthFix' class='more'></image>
<view class='imTit'>更多...</view>
</view>
</view>
</view>
</view>

<!-- 爆款专区 -->
<c-hot id="hot" />
<view class='product' tt:if="{{showTopic}}" bindtap='gotoTopic'>
<image src='{{cover}}' mode='widthFix'></image>
</view>


<c-coupons id="lists" bind:myevent="onGetCode" class="business" loadingtext="{{loadingtext}}"
loading="{{loading}}" />
<!-- 广告蒙层 -->
<!-- <c-advertisement id="advertisement" tt:if="{{showGg&&!played&&!havePlayEd1}}" ggdata="{{ggdata}}" /> -->
</view>
<!-- 顶部签到成长值 -->
<view class='signin' tt:if="{{fistLogin}}" animation="{{alphaData}}">
<open-data class="open" type="userAvatarUrl"></open-data>
<text class='text'>您今日签到成功,获得{{fistLogin}}成长值</text>
</view>
<view class="integralBox" tt:if="{{businessSwitch}}">
<!--是未授权微信且未授权手机号 -->
<navigator url="/pages/getuserinfo/index" open-type="navigate" tt:if="{{accreditFlag==1}}">
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix'
style="width: 100%;height: 100%;"></image>
</navigator>
<!-- 授权了微信 没授权手机号 -->
<navigator url="/pages/getuserinfo/index" open-type="navigate" tt:if="{{accreditFlag==2}}">
<image src='https://formall.oss-accelerate.aliyuncs.com/cimg/self-help-integral.png' mode='widthFix'
style="width: 100%;height: 100%;"></image>
</navigator>
</view>
</view>

+ 16
- 13
index/searchbar.js 查看文件

@@ -11,7 +11,7 @@ Page({
data: {
navigationBarHeight,
navLineHeight: ((app.statusBarHeight + app.statusBarHeight) + 50) + "px",
navImgHeight:(((app.statusBarHeight + app.statusBarHeight) + 34)/2) + "px",
navImgHeight: (((app.statusBarHeight + app.statusBarHeight) + 34) / 2) + "px",
lists: [],
merchantVoList: [],
indexId: 0,
@@ -23,11 +23,11 @@ Page({
teljpgUrl: imgurl.teljpg.url,
map: imgurl.map.url, //商场地图
mapUrl: '/pages/marketAtlas/marketAtlas', //跳转地图的路径
mouldType:0,
mouldType: 0,
},
getFemgMap() { //判断时候对接封了地图
Http.get({
url: config.api.ifFengMap
url: config.api.ifFengMap + `?mallTenantId=${tt.getStorageSync('mallTenantId')||""}`
}).then(res => {
if (res.data) { //
let initMpa = {
@@ -82,13 +82,13 @@ Page({
*/
gotoDetail(e) {
tt.navigateTo({
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}&mallTenantId=${tt.getStorageSync('mallTenantId') || ""}`
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
this.setData({
mouldType: app.globalData.mouldType,
})
@@ -112,19 +112,20 @@ Page({
})
};
tt.getSystemInfo({
success: function(res) {
success: function (res) {
that.setData({
windowHeight: res.windowHeight
})
},
})
},
getBussiness: function() {
getBussiness: function () {
let that = this;
Http.get({
url: config.api.businessList,
data: {
filter: 1
filter: 1,
mallTenantId: tt.getStorageSync('mallTenantId') || ""
}
}).then(res => {
that.setData({
@@ -144,19 +145,21 @@ Page({
});
})
},
getList: function(page, businessId) {
getList: function (page, businessId) {
let that = this;
let data;
if (businessId == 0) {
data = {
pageNum: page,
pageSize: 8
pageSize: 8,
mallTenantId: tt.getStorageSync('mallTenantId') || ""
}
} else {
data = {
pageNum: page,
pageSize: 8,
businessId: businessId
businessId: businessId,
mallTenantId: tt.getStorageSync('mallTenantId') || ""
}
}
Http.get({
@@ -189,7 +192,7 @@ Page({
});
})
},
phone: function(e) {
phone: function (e) {
let that = this;
if (e.currentTarget.dataset.merchantlinkphone) {
tt.makePhoneCall({
@@ -200,7 +203,7 @@ Page({
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
let that = this;
that.data.page++;
that.setData({


+ 28
- 21
index/user.js 查看文件

@@ -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,
})
@@ -63,6 +64,13 @@ Page({
},
});
},

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

getmemberId: function (token) {
Http.get({
url: config.api.getScore,
@@ -91,19 +99,19 @@ 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) => {

@@ -111,9 +119,9 @@ Page({
// });
},
onShow: function (options) {
this.setData({
mouldType:app.globalData.mouldType
mouldType: app.globalData.mouldType
})
this.getmemberId()
Http.get({
@@ -124,27 +132,26 @@ 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',


+ 33
- 24
index/user.ttml 查看文件

@@ -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 />

+ 5
- 4
pages/bannerdetail/bannerdetail.js 查看文件

@@ -22,14 +22,15 @@ Page({
mouldType: app.globalData.mouldType,
})
let that = this;
if (options.id){
if (options.id) {
Http.get({
url: config.api.bannerDetail,
data: {
id: options.id
id: options.id,
mallTenantId: options.mallTenantId,
}
}).then(res => {
if(res.data.type==2){
if (res.data.type == 2) {
that.setData({
nodes: res.data.html
})
@@ -52,4 +53,4 @@ Page({
url: '/index/index',
})
},
});
});

+ 305
- 213
pages/coupon/confirmation/confirmation.js 查看文件

@@ -7,14 +7,28 @@ const imgurl = require("../../../utils/imgurl");
Page({
data: {
couponIds: "",
showPhoem: false,
couponChannelId: "",
showPage: false,
data: {},
spuIdObj: {},
priceAndStockObj: {}
priceAndStockObj: {},
mallTenantId: ''
},
onLoad: function (options) {
console.log(options);
console.log(options, 'options!!!!!!!');

if (options.mallTenantId) {
this.setData({
mallTenantId: options.mallTenantId,
})
} else {
this.setData({
mallTenantId: tt.getStorageSync('mallTenantId'),
})
}
console.log(this.data.mallTenantId, 'mallTenantId');

tt.showLoading({
title: "加载中..."
});
@@ -53,7 +67,9 @@ Page({
getSupId(id) {
Http.get({
url: config.api.getSpuid,
data: { id: id }
data: {
id: id
}
}).then(res => {
if (res.data) {
this.setData({
@@ -70,11 +86,55 @@ 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: {
couponChannelId
couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
let tempBoj = JSON.parse(res.data)
@@ -88,7 +148,7 @@ Page({
let that = this;
let data = {};

that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存
that.getCouponPriceAndStock(couponChannelId); //获取券价格和库存
if (that.data.couponIds) {
data.couponId = couponChannelId
} else {
@@ -241,37 +301,52 @@ Page({
})
},
/**
* 支付订单更新
*/
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this, composeOrderType) => {
* 支付订单更新
*/
payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType) {
let that = this;
console.log(orderId, 'orderId');
// 支付成功
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,
mallTenantId: that.data.mallTenantId
}
})
.then(res => {
tt.hideLoading()
// 有价券
if (!type && type != 'free') {
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${orderId
}`
});
console.log('Over Here! type');
setTimeout(() => {
console.log(_this.data.orderFlag, orderId, that.data.mallTenantId, 'notice!!!');
let url = ""
if (_this.data.orderFlag) {
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${orderId}&dingdan=order&mallTenantId=${that.data.mallTenantId}`
});
} else {
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${orderId}&mallTenantId=${that.data.mallTenantId}`
});
}

}, 1600);
} else if (type == 'free') {
console.log('Over Here! type2');
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${orderId
}`
}&mallTenantId=${that.data.mallTenantId}`
});
}
})
.catch(err => {
console.log(err);
console.log('Over Here! type3');
if (!type) {
setTimeout(function () {
_this.payOrderUpdate(orderId, payOrderId, status, reason, type, _this, composeOrderType);
@@ -286,7 +361,8 @@ Page({
Http.get({
url: config.api.getUnPaidOrder,
data: {
couponId: couponId
couponId: couponId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
that.setData({
@@ -324,13 +400,13 @@ 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}`,
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&mallTenantId=${that.data.mallTenantId}`,
})
} else {
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}`,
url: `/pages/order/detail/index?orderId=${res.data.composeOrderId}&mallTenantId=${that.data.mallTenantId}`,
})
}

@@ -364,7 +440,7 @@ Page({
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
token: app.globalData.token,
}
}).then(res => {
Http.get({
@@ -373,141 +449,155 @@ 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
data.mallTenantId = that.data.mallTenantId || ''
}
/**
* 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,
mallTenantId: that.data.mallTenantId
}
}).then(res => {
console.log(res, "789789");
let tempCallbackData = res.data.callbackData
// 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 => {
console.log('save,success!');
tt.hideLoading();
that.setData({
showbutton: false,
})
const {
orderId,
outOrderNo
} = res;
that.setData({
orderId,
outOrderNo
});
that.payOrderUpdate(outOrderNo, outOrderNo, 1, '', '', that, '');
},
fail: res => {
console.log('save,fail!');
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 +634,7 @@ Page({
})
}
}
}
else if (res.code === 1) {
} else if (res.code === 1) {
that.setData({
showbutton: false
})
@@ -605,66 +694,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,13 +898,19 @@ 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}&mallTenantId=${that.data.mallTenantId}&path=qr`,
});
} else {
this.setData({
showPhoem: true
})
}
} else if (err.code == 11006) {
// 用户手机已加密
tt.navigateTo({
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&path=qr`
url: `/pages/getPhone/getPhone?couponChannelId=${that.data.couponChannelId}&mallTenantId=${that.data.mallTenantId}&path=qr`
});
} else {
tt.showToast({
@@ -834,10 +929,9 @@ Page({
console.log(err)
if (err.code == 11004) {
tt.navigateTo({
url: `/pages/getuserinfo/getuserinfo?fromflag=confirmation&confirmationFlag=${that.data.couponChannelId}`,
url: `/pages/getuserinfo/getuserinfo?fromflag=confirmation&confirmationFlag=${that.data.couponChannelId}&mallTenantId=${that.data.mallTenantId}`,
})
} else {

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


})

+ 1
- 1
pages/coupon/confirmation/confirmation.json 查看文件

@@ -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",


+ 7
- 5
pages/coupon/confirmation/confirmation.ttml 查看文件

@@ -1,23 +1,25 @@
<view class="commodityBox">
<view class="commodityImgBox">
<image class="commodityImg" src="{{data.coverImg}}"></image>
<image class="commodityImg" src="{{data.coverImg}}"></image>
</view>
<view class="contentBox">
<view class="topBox">
<view class="title">{{data.title}}</view>
<view class="unit">{{data.type==50?priceAndStockObj.creditPrice+'积分':'¥'+priceAndStockObj.salePrice/100}}</view>
<view class="unit">{{data.type==50?priceAndStockObj.creditPrice+'积分':'¥'+priceAndStockObj.salePrice/100}}
</view>
</view>
<view class="subhead"> {{data.subTitle}}</view>
<view class="subhead">{{data.subTitle}}</view>
</view>

<view class="app-border-topX">
<view class="actually"> 实付 </view>
<view class="payZ">{{data.type!=50?'¥':''}}</view>
<view class="payZ">{{data.type!=50?'¥':''}}</view>
<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>
<image class="goImg" src="../../../assets/itemImg/chevron.png" ></image>
<image class="goImg" src="../../../assets/itemImg/chevron.png"></image>
</view>

+ 196
- 147
pages/coupon/detail/index.js 查看文件

@@ -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,12 @@ Page({
//图文混排
curHtml: '',
contentType: 0,
page: 1,//查询商户优惠券page
page: 1, //查询商户优惠券page
idList: [],
showBox: false,//手机号授权框
spuIdObj: {}
showBox: false, //手机号授权框
spuIdObj: {},
mallTenantId: '',
mallList: []
},

/**
@@ -116,39 +118,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 +161,7 @@ Page({
})
},

setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功
this.setData({
showBox: paramData.detail,
})
@@ -255,9 +257,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 +280,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 +305,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 +362,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 +407,7 @@ Page({
data: {
token: app.globalData.token
}
}).then(res => {
}).catch(err => {
}).then(res => {}).catch(err => {
if (err.code == 11004) {
this.setData({
isGetUser: false
@@ -417,7 +418,7 @@ Page({

gotopay: function (e) {
tt.navigateTo({
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}`,
url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}&mallTenantId=${this.data.mallTenantId}`,
})
return
},
@@ -483,54 +484,85 @@ Page({
* 获取用户信息
*/
onLoad(options) {
console.log(options);

this.setData({
mouldType: app.globalData.mouldType,
})
let that = this;
if (options.g) {
app.globalData.havePlayEd1 = true;
}
tt.showLoading({
title: "加载中..."
});
that.setData({
onshow: false
})
if (options && (options.couponChannelId || options.couponIds)) {

if (options.couponIds) {
const dealData = options => {
console.log(options, 'options');
if (options.mallTenantId || options.tenantId) {
tt.setStorageSync('locationSwitch', 0);
this.setData({
couponIds: options.couponIds
mallTenantId: options.mallTenantId || options.tenantId,
})
that.getDetail(options.couponIds, 'notendclock');
} else {
that.getDetail(options.couponChannelId, 'notendclock');
that.getSupId(options.couponChannelId)
}

Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
console.log(res.data, 'subMall');
const mallList = res.data
mallList.forEach((item, index) => {
if (item.tenantId == (options.mallTenantId || options.tenantId)) {
tt.setStorageSync('mallTenantId', options.mallTenantId || options.tenantId)
tt.setStorageSync('mallIndex', index)
}
})
}).catch(err => {})

}
/**
* 转赠判断
*/
if (options.cuserId) {
this.setData({
showCardOffer: true,
cardData: options
mouldType: app.globalData.mouldType,
})
this.getUserInfo()
}
that.setData({
couponChannelId: options.couponChannelId,
title: that.data.data.title ? that.data.data.title : '',
});
if (options.cardType) {
let that = this;
if (options.g) {
app.globalData.havePlayEd1 = true;
}
tt.showLoading({
title: "加载中..."
});
that.setData({
cardType: options.cardType
onshow: false
})
if (options && (options.couponChannelId || options.couponIds)) {

if (options.couponIds) {
this.setData({
couponIds: options.couponIds
})
that.getDetail(options.couponIds, 'notendclock');
} else {
that.getDetail(options.couponChannelId, 'notendclock');
that.getSupId(options.couponChannelId)
}


}
/**
* 转赠判断
*/
if (options.cuserId) {
this.setData({
showCardOffer: true,
cardData: options
})
this.getUserInfo()
}
that.setData({
couponChannelId: options.couponChannelId,
title: that.data.data.title ? that.data.data.title : '',
});
if (options.cardType) {
that.setData({
cardType: options.cardType
})
}
}

if (app.globalData.token) {
dealData(options)
} else {
app.tokenCallback = token => {
dealData(options)
}

}

},
getHtml(couponChannelId) {
Http.get({
@@ -552,7 +584,10 @@ Page({
getSupId(id) {
Http.get({
url: config.api.getSpuid,
data: { id: id }
data: {
id: id,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
if (res.data) {
this.setData({
@@ -569,11 +604,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,26 +619,33 @@ Page({
})
})
},
getCouponMerchant(couponChannelId) {//获取适用门店
getCouponMerchant(couponChannelId) { //获取适用门店
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId
data: {
couponChannelId: couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
if (res.data && res.data.length) {
let merchantVoList = res.data
let idList = []
merchantVoList.map(item => {
idList.push(item.id)
})
this.setData({
idList: idList
})
this.getCouponList(idList) //获取推荐列表
}
const keys = Object.keys(res.data)
const mallList = []
let i = 0
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: false
}
if (i == 0) {
obj.expand = true
}
mallList.push(obj)
i++
})
this.setData({
merchantVoList: res.data
mallList: mallList
})
})
},
@@ -610,14 +653,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 +730,7 @@ Page({
});
var EndTime = res.data.validStartDate;
var NowTime = new Date().getTime();
/**
* activityStatus==0 活动未开始
* activityStatus==1 活动已开始
@@ -756,7 +802,7 @@ Page({
}
}


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

}
@@ -818,14 +864,16 @@ 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({
data: tempObj
})
console.log(this.data.data, "data");
const mallTenantId = this.data.data.tenantId
tt.setStorageSync('mallTenantId', mallTenantId)
}
}).catch(err => {
tt.showToast({
@@ -855,14 +903,15 @@ 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,
mallTenantId: this.data.mallTenantId || ''
}
})
.then(res => {
tt.hideLoading()
// 有价券
@@ -890,9 +939,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()
@@ -904,7 +953,7 @@ Page({
*
*/
tt.redirectTo({
url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate,
url: "/pages/getphoneInfo/index?path=index&cuserId=" + that.data.cardData.cuserId + "&couponChannelId=" + that.data.cardData.couponChannelId + "&userName=" + that.data.cardData.userName + "&coverImg=" + that.data.cardData.coverImg + "&avatarUrl=" + that.data.cardData.avatarUrl + "&couponOrderId=" + that.data.cardData.couponOrderId + "&updateDate=" + that.data.cardData.updateDate
});
} else if (err.code == 11006) {
// 用户手机已加密
@@ -978,7 +1027,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 +1052,7 @@ Page({


onShow() {
this.ifGetUser()//判断是否授权抖音
this.ifGetUser() //判断是否授权抖音
this.setData({
mouldType: app.globalData.mouldType,
showbutton: false,
@@ -1031,7 +1080,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 +1092,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


+ 13
- 12
pages/coupon/detail/index.json 查看文件

@@ -1,13 +1,14 @@
{
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"c-coupons": "../../../components/coupons/index",
"phoen":"../../../components/getPhoen/getPhoen"
},
"navigationBarTitleText": "",
"backgroundColor":"#f4f4f4",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop",
"c-coupons": "../../../components/coupons/index",
"phoen": "../../../components/getPhoen/getPhoen"
},
"navigationBarTitleText": "",
"backgroundColor": "#f4f4f4",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": true
}

+ 39
- 30
pages/coupon/detail/index.ttml 查看文件

@@ -49,9 +49,9 @@
</view>
</view>
<text class='title'>{{data.title}}<text class="elecard" tt:if="{{data.type==100}}">电子卡</text></text>
<!-- 预购 -->
<view class="moneyBox" tt:if="{{data.type==10}}">
<view class="earnest">定金:</view>
@@ -77,18 +77,21 @@
<text class='jifen'>积分</text>
</view>

<text class='throgh' tt:if="{{data.unit==0&&data.type!=50&&data.type!=51}}">{{priceAndStockObj.price/100}}元</text>
<text class='throgh'
tt:if="{{data.unit==0&&data.type!=50&&data.type!=51}}">{{priceAndStockObj.price/100}}元</text>
<text tt:if="{{data.unit==1&&data.type!=50&&data.type!=51}}">{{priceAndStockObj.price/100}}小时</text>

</view>
<view class="fl" tt:if="{{data.type==8}}">
<text class="pri01">{{priceAndStockObj.salePrice/100}}</text>
<text class='presslimit' tt:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text>
<text class='throgh'>{{priceAndStockObj.price/100}}元</text>

</view>
<view class="sellBox"> {{'已售'+(priceAndStockObj.inventory-priceAndStockObj.remainInventory)+'|'+'库存'+priceAndStockObj.remainInventory}}</view>
<view class="sellBox">
{{'已售'+(priceAndStockObj.inventory-priceAndStockObj.remainInventory)+'|'+'库存'+priceAndStockObj.remainInventory}}
</view>
</view>

<!-- <view class="subTitleBox">
@@ -107,16 +110,17 @@
<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>
</vieW>
<view class="groupTextBox" tt:if="{{data.itemGroup.length>0}}" tt:for="{{data.itemGroup}}">
<view class="groupTitleS">{{item.group_name}}</view>
<view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi">
<view class="groupTiemBox" >
<view class="groupTiemBox">
<view class="yuandian"></view>
<view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view>
<view class="groupTiemPay">¥{{itemChi.price/100}}</view>
@@ -130,17 +134,20 @@


<!-- 适用门店 -->
<store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store>
<!-- <store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store> -->

<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>

<view class='notes'>
<view class="notesH">购买须知</view>
<view class="notesH">购买须知</view>
<view class="timeText">有效期</view>
<view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view>
<view class="timeText">可用时间</view>
<view class="Hchild">• 商家营业时间内到店使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.weekend}}">• 周末不支持使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用
</view>

<view class="timeText">购买限制</view>
<view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view>

@@ -148,7 +155,7 @@
<view class="Hchild" tt:if="{{!data.subscribeSing}}">• 无需预约,高峰时段可能等位</view>
<view class="Hchild" tt:if="{{data.subscribeSing}}">• {{data.subscribeSing}}</view>

<view class="timeText" tt:if="{{data.rec_person_num_max}}">适用人数</view>
<view class="Hchild" tt:if="{{data.rec_person_num_max}}">• 该团购劵最多{{data.rec_person_num_max}}人使用</view>

@@ -156,8 +163,9 @@
<view class="Hchild">• 团购券不支持配送或外卖</view>
<view class="Hchild" tt:if="{{data.pack}}">• 该团购商品{{data.pack=='false'?'不支持':'支持'}}打包</view>
<view class="Hchild" tt:if="{{data.besides}}">• {{data.besides=="false"?'不可以':'可以'}}外带餐食</view>
<view class="Hchild" tt:if="{{data.superimposed_discounts}}">• {{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>

<view class="Hchild" tt:if="{{data.superimposed_discounts}}">•
{{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>
<view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view>

<view class="notesH">使用规则</view>
@@ -171,9 +179,10 @@
<text class="Hchild">{{item.content}}</text>
</view>
</view>
<view tt:if="{{couponList.length!=0}}"
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;">其他活动
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;">
其他活动
</view>
<view class='couponsL clearfix'>
<c-coupons tt:if="{{couponList.length!=0}}" tt:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}"
@@ -184,7 +193,7 @@
</view>
</view>

<form data-type='{{data.type}}' report-submit='true' tt:if="{{mouldType!=1}}">
<form data-type='{{data.type}}' report-submit='true' tt:if="{{mouldType!=1}}">
<view class="buy-view app-border-top" style="position:fixed;z-index:{{zIndex}};">
<button class='goback' bindtap='goback'>
<image src='{{homeSelectedO}}' mode="widthFix"></image>
@@ -214,14 +223,14 @@
<button class='buy' disabled='true' tt:if="{{total_micro_second<=0&&data.activityStatus!=0}}">活动已结束</button>
<button id='noBuy' disabled='true' tt:if="{{data.activityStatus==0}}">活动未开始</button>
</view>
</form>
</form>

<form data-type='{{data.type}}' report-submit='true' tt:if="{{mouldType==1}}">
<form data-type='{{data.type}}' report-submit='true' tt:if="{{mouldType==1}}">
<view class="app-border-topX" style="position:fixed;z-index:{{zIndex}}; bottom: 0;">
<view class="biaoz">{{data.type!=50?'¥':''}}</view>
<view class="selling">{{data.type==50?priceAndStockObj.creditPrice+'积分':priceAndStockObj.salePrice/100}} </view>
<view class="qsOriginal">¥{{priceAndStockObj.price/100}}</view>
<view class="qsOriginal">¥{{priceAndStockObj.price/100}}</view>
<button bindtap="gotopay" disabled='{{showbutton}}' hover-class='active' class='buyX'
tt:if="{{data.type!=11&&data.type!=8&&data.type!=50&&data.type!=51&&priceAndStockObj.salePrice/100!=0&&priceAndStockObj.remainInventory!=0&&endtime!='活动已结束'&&data.activityStatus!=0}}">
马上购买</button>
@@ -247,8 +256,8 @@
<button id='buyX' disabled='true' tt:if="{{data.activityStatus==0}}">活动未开始</button>
<!-- <view class="sell">已售出<span class="sellP">{{data.inventory-priceAndStockObj.remainInventory}}</span>件</view> -->
<button class="serviceBox" 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>
</button>
</view>
@@ -261,7 +270,7 @@
<image src='{{homeSelectedO}}' mode="widthFix"></image>
<text class='btnTxt'>首页</text>
</button>
<form report-submit='true' class="fl">
<form report-submit='true' class="fl">
<button bindtap="gotopay" style='background:transparent;color:#fff;' data-discount='discount1'
disabled='{{showbutton}}'>
<text>¥{{priceAndStockObj.price/100}}</text>
@@ -296,7 +305,7 @@
</label>
</radio-group>
<!-- 多选 -->
<checkbox-group bindchange="checkboxChange" tt:if="{{questionnaire.flag=='multi'}}" >
<checkbox-group bindchange="checkboxChange" tt:if="{{questionnaire.flag=='multi'}}">
<label class="radio ques" tt:for="{{questionnaire.answers}}" tt:key="index">
<checkbox value="{{item.id}}" />{{item.name}}
</label>
@@ -344,11 +353,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>
</view>

+ 131
- 68
pages/couponorder/detail/index.js 查看文件

@@ -6,31 +6,35 @@ const util = require("../../../utils/util");
const QR = require("../../../utils/memberqrcode.js");
Page({
data: {
showIdFalg:false,
showIdFalg: false,
navigationBarHeight,
couponorderstatus:"",
quancode:"",
setInter:"",
validStartDate:"",
validEndDate:"",
pickStartDate:"",
pickEndDate:"",
expiredTime:"",
updateDate:"",
createDate:"",
code:"",
data:{
couponorderstatus: "",
quancode: "",
setInter: "",
validStartDate: "",
validEndDate: "",
pickStartDate: "",
pickEndDate: "",
expiredTime: "",
updateDate: "",
createDate: "",
code: "",
data: {
},
showhieRq:false,
dynamicRq:"",
expiredSeconds:0,
templTiem:"",
curHtml:"",
showhieRq: false,
dynamicRq: "",
expiredSeconds: 0,
couponTenantId: '',
templTiem: "",
curHtml: "",
tenantId: '',
mallList: '',
mallTenantId: ""
},
showId(){
showId() {
let this_ = this;
if(!this_.data.showIdFalg){
if (!this_.data.showIdFalg) {
tt.showModal({
// title: "查看券码",
content: "是否查看完整券码",
@@ -38,7 +42,7 @@ Page({
if (res.confirm) {
console.log("confirm, continued");
this_.setData({
showIdFalg:true
showIdFalg: true
})
} else if (res.cancel) {
//取消
@@ -51,13 +55,44 @@ Page({
console.log(`showModal 调用失败`, err);
},
});
}else{
} else {
this.setData({
showIdFalg:false
showIdFalg: false
})
}
},

//获取适用门店
getCouponMerchant(couponId) {
Http.get({
url: `/wxCoupon/couponMerchantByCouponId?couponId=${couponId}&mallTenantId=${this.data.mallTenantId || ''}`,
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
let i = 0
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: false
}
if (i == 0) {
obj.expand = true
}
mallList.push(obj)
i++
})
this.setData({
mallList: mallList
})
}).catch(err => {

})
},

getHtml(couponOrderId) {
Http.get({
url: config.api.couponHtmlDetailForPkg,
@@ -75,31 +110,47 @@ Page({
}
})
},

onLoad: function (options) {
let that = this;
console.log(options);
that.setData({
code: options.quancode,
codeS: options.quancode.slice(0,4)+`******`+options.quancode.slice(14),
codeS: options.quancode.slice(0, 4) + `******` + options.quancode.slice(14),
couponorderstatus: options.couponorderstatus,
validStatus:options.validStatus
validStatus: options.validStatus
});

if(options.couponorderstatus==0&&options.validStatus!=0){
that.setRq()//动态二维码 //这个方法必须在拿到 options.quancode 后调用
if (options.couponorderstatus == 0 && options.validStatus != 0) {
that.setRq() //动态二维码 //这个方法必须在拿到 options.quancode 后调用
}

if (options.mallTenantId) {
that.setData({
mallTenantId: options.mallTenantId
})
}

//初始数据不能延时收到写一边
Http.get({
url: config.api.couponOrderDetail,
data: {
couponOrderId: options.quancode
couponOrderId: options.quancode,
mallTenantId: options.mallTenantId
}
}).then(res => {
if (res.data.tenantId) {
that.setData({
tenantId: res.data.tenantId
})
that.setRq()
that.getCouponMerchant(res.data.couponId)
}
that.setData({
couponorderstatus: res.data.couponOrderStatus,
data: res.data,
});

that.setData({
expiredTime: util.formatTime(that.data.data.expiredTime, "yyyy-MM-dd hh:mm:ss"),
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
@@ -120,19 +171,20 @@ Page({
// pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"),
})
}
}).catch(err => {
tt.showToast({
title: err.message?err.message:err.data,
icon: 'none',
duration: 2000,
mask: false
});
console.log(err, 'err');
tt.showToast({
title: err.message ? err.message : err.data,
icon: 'none',
duration: 2000,
mask: false
});
})
//



//获得优惠券的详情
let setInter = setInterval(function () {
@@ -140,18 +192,26 @@ Page({
options.quancode &&
that.data.couponorderstatus == 0
) {
Http.get({
url: config.api.couponOrderDetail,
data: {
couponOrderId: options.quancode
couponOrderId: options.quancode,
mallTenantId: options.mallTenantId
}
}).then(res => {
console.log(res.data, '1233211234567');
that.setData({
couponorderstatus: res.data.couponOrderStatus,
data: res.data,
});
if (res.data.tenantId) {
that.setData({
tenantId: res.data.tenantId
})
that.setRq()
}
console.log(that.data.tenantId, 'tenantId');
that.setData({
expiredTime: util.formatTime(that.data.data.expiredTime, "yyyy-MM-dd hh:mm:ss"),
updateDate: util.formatTime(that.data.data.updateDate, "yyyy-MM-dd hh:mm:ss"),
@@ -165,62 +225,65 @@ Page({
// pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd hh:mm:ss"),
})
}
}).catch(err => {
tt.showToast({
title: err.message?err.message:err.data,
icon: 'none',
duration: 2000,
mask: false
});
})
tt.showToast({
title: err.message ? err.message : err.data,
icon: 'none',
duration: 2000,
mask: false
});
})
}
}, 2000);
that.setData({
setInter:setInter
setInter: setInter
})
},
setRq(){
setRq() {
let _this = this
_this.setData({
showhieRq: false,
})
Http.get({//获取动态二维码
Http.get({ //获取动态二维码
url: config.api.dynamicId,
data: {
couponOrderId: _this.data.code
couponOrderId: _this.data.code,
couponTenantId: _this.data.tenantId || ''
}
}).then(res => {
console.log(res, "res")
_this.setData({
dynamicRq: res.data.dynamicId,
expiredSeconds: res.data.expiredSeconds
expiredSeconds: res.data.expiredSeconds,
couponTenantId: res.data.couponTenantId
})

let url = JSON.stringify({
END: "C",
TYPE: "couponorder",
ID: _this.data.dynamicRq
ID: _this.data.dynamicRq,
couponTenantId: _this.data.couponTenantId
})
if(res.data.expiredSeconds==0){
if (res.data.expiredSeconds == 0) {

}else{
let inre = setInterval(()=>{
if(_this.data.expiredSeconds>1){
} else {
let inre = setInterval(() => {
if (_this.data.expiredSeconds > 1) {
_this.setData({
expiredSeconds: _this.data.expiredSeconds-1
expiredSeconds: _this.data.expiredSeconds - 1
})
console.log("有效",_this.data.expiredSeconds)
}else{
console.log("有效", _this.data.expiredSeconds)
} else {
console.log("无效", _this.data.expiredSeconds)
clearInterval(_this.data.templTiem)
_this.setData({
showhieRq:true
showhieRq: true
})
}
},1000)
}
}, 1000)
_this.setData({
templTiem:inre
templTiem: inre
})
}
// util.qrcode("qrcode", url, 350, 350);
@@ -238,7 +301,7 @@ Page({
createQrCode: function (url, canvasId, cavW, cavH) {
//调用插件中的draw方法,绘制二维码图片
let that = this;
QR.api.draw(url, canvasId, cavW, cavH, function (res) {
QR.api.draw(url, canvasId, cavW, cavH, function (res) {
that.setData({
tempFilePath: res
})


+ 8
- 7
pages/couponorder/detail/index.json 查看文件

@@ -1,9 +1,10 @@
{
"navigationBarTitleText": "使用优惠券",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store":"../../../components/store/index"
}
"navigationBarTitleText": "使用优惠券",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop"
}
}

+ 19
- 17
pages/couponorder/detail/index.ttml 查看文件

@@ -1,11 +1,11 @@
<view class="BoxBg">
<!-- <navbar back home text="使用优惠券" background='#fff' color="#000"></navbar>
<view style="height:{{navigationBarHeight}} "></view> -->
<view class="container">
<view class="logoBox">
<image src="{{data.coverImg}}" class="logo" mode='aspectFill'/>
<image src="{{data.coverImg}}" class="logo" mode='aspectFill' />
</view>
<view class="quanDataBox">
<view class="qianTitle">{{data.title}}</view>
@@ -13,7 +13,7 @@
<view class="payBox">
<view class="selling">¥{{data.couponPrice/100}}</view>
<view class="original">¥{{data.price/100}}</view>
<view class="past" tt:if="{{data.autoRefund==1}}" >过期不退款</view>
<view class="past" tt:if="{{data.autoRefund==1}}">过期不退款</view>
</view>
<view class="timevalidity">有效期至:{{expiredTime}}</view>
<view class="manjian" tt:if="{{data.usePrice}}">满{{data.usePrice/100}}元可用</view>
@@ -23,7 +23,8 @@
<image tt:if="{{couponorderstatus==1}}" src="../../../assets/itemImg/wm01.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==2}}" src="../../../assets/itemImg/wm02.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==3}}" src="../../../assets/itemImg/wm03.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==0&&validStatus==0}}" src="../../../assets/itemImg/wm04.jpg" mode='widthFix'></image>
<image tt:if="{{couponorderstatus==0&&validStatus==0}}" src="../../../assets/itemImg/wm04.jpg"
mode='widthFix'></image>
<view class="panel" tt:if="{{couponorderstatus==0&&validStatus!=0}}">
<view class="rqImg">
<canvas canvas-id="qrcode" style="width: 420rpx;; height: 420rpx;margin: 28rpx auto;" />
@@ -34,24 +35,25 @@
<view class="upDataRq">点一点刷新二维码</view>
</view>
<view class="coedTiem" tt:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>
<view class="barnum">
<view class="barnumtext">{{showIdFalg?code:codeS}}</view>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
</view>
</view>

<view class="shopData">
<store merchantVoList="{{data.merchantVoList}}"></store>
</view>
<view class="shopData">
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>
</view>
<image class="line" mode="widthFix" src="../../../assets/itemImg/topLine.png" />
<view class="note">
<view style='height:60rpx;line-height:60rpx;'>
<text class="shiji">实付金额:</text>
<text style='font-size:24rpx;text-align:right;color: #FF4949;float: right;margin-right: 50rpx;'>元</text>
<text
style='font-size:24rpx;text-align:right;color: #FF4949;float: right;margin-right: 50rpx;'>元</text>
<text class='moneys'>{{data.couponPrice/100}}</text>
</view>
<view class="orderDate" tt:if="{{data.couponOrderStatus==0}}">{{createDate}}</view>
@@ -61,12 +63,12 @@

<view class="orderNum">{{data.orderId}}</view>
</view>
<view class="notes">
<!-- <view class="notes">
<view class="notesText">购买须知</view>
<text class="introduce" tt:if="{{curHtml==''}}"> {{data.remark}}</text>
<!-- <text class="notesText" tt:if="{{curHtml==""}}">{{detailObj.remark}}</text> -->
<rich-text class="rich_text" tt:if="{{curHtml!=''}}" nodes="{{curHtml}}"></rich-text>
</view>
<text class="introduce" tt:if="{{data.remark}}"> {{data.remark}}</text>
<text class="notesText" tt:if="{{curHtml==""}}">{{detailObj.remark}}</text>
<rich-text class="rich_text" tt:if="{{curHtml!='' && !data.remark}}" nodes="{{curHtml}}"></rich-text>
</view> -->
</view>
</view>
</view>

+ 88
- 52
pages/couponorder/index/index.js 查看文件

@@ -6,94 +6,117 @@ const util = require("../../../utils/util");
Page({
data: {
navigationBarHeight,
boatLsit:[
{
name:"未使用",
value:"0"
boatLsit: [{
name: "未使用",
value: "0"
},
{
name:"已使用",
value:"1"
name: "已使用",
value: "1"
},
{
name:"已过期",
value:"2"
name: "已过期",
value: "2"
},
{
name:"已退款",
value:"3"
name: "已退款",
value: "3"
},
],
boatFlag:"0",
content:"",
boatFlag: "0",
content: "",
loading: false, //"上拉加载"的变量,默认false,隐藏
pageNum:1,
pageNum: 1,
allow_load: true,
list:[],
list: [],
shopList: [],
mallTenantId: tt.getStorageSync('mallTenantId') || '',
index: tt.getStorageSync('mallIndex') || 0
},
setBoatFlag(e){
setBoatFlag(e) {
let index = e.currentTarget.dataset.index
console.log(index);
this.setData({
boatFlag:index,
pageNum:1,
list:[],
boatFlag: index,
pageNum: 1,
list: [],
allow_load: true,
loading: false, //"上拉加载"的变量,默认false,隐藏
})
this.getList()
},
getList(){

mallSync() {
this.setData({
mallTenantId: tt.getStorageSync('mallTenantId') || '',
index: tt.getStorageSync('mallIndex') || 0,
})
},

bindPickerChange(e) {
const index = e.detail.value
const mallTenantId = this.data.shopList[index].tenantId
tt.setStorageSync('mallTenantId', mallTenantId)
tt.setStorageSync('mallIndex', index)
this.setData({
index: index,
mallTenantId: mallTenantId,
allow_load: true
});
console.log(this.data.mallTenantId);
this.getList(this.data.boatFlag, 1);
},

getList() {
let that = this
if (that.data.allow_load) {
that.setData({
loading: true,
content: '小主,我在玩命加载中...'
})

Http.get({
url:config.api.couponOrderList,
data:{
pageNum:that.data.pageNum,
url: config.api.couponOrderList,
data: {
pageNum: that.data.pageNum,
pageSize: 10,
couponOrderStatus:that.data.boatFlag=="all"?"":that.data.boatFlag,
couponOrderStatus: that.data.boatFlag == "all" ? "" : that.data.boatFlag,
mallTenantId: that.data.mallTenantId
}
}).then(res=>{
if(that.data.pageNum==1){
}).then(res => {
if (that.data.pageNum == 1) {
that.setData({
list: []
})
}
let tempArr= that.data.list
if(tempArr.length>0){
tempArr.map(item=>{
let tempArr = that.data.list
if (tempArr.length > 0) {
tempArr.map(item => {
item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd ");
})
}
if(that.data.pageNum>=res.data.pages){
if (that.data.pageNum >= res.data.pages) {
that.setData({
allow_load: false
})
}
if(that.data.pageNum>1){//分页
if (that.data.pageNum > 1) { //分页
that.setData({
list: res.data.list?[...tempArr ,...res.data.list]:tempArr,
loading:false
list: res.data.list ? [...tempArr, ...res.data.list] : tempArr,
loading: false
})
}else{
let tempLsit = res.data.list?res.data.list:[]
if(tempLsit.length>0){
tempLsit.map(item=>{
} else {
let tempLsit = res.data.list ? res.data.list : []
if (tempLsit.length > 0) {
tempLsit.map(item => {
item.expiredTime = util.formatTime(item.expiredTime, "yyyy-MM-dd");
})
}
that.setData({
list: tempLsit,
loading:false
loading: false
})
}
}).catch(err => {
@@ -102,7 +125,7 @@ Page({
icon: "none"
});
})
}else {
} else {
that.setData({
loading: true,
content: "——— 再拉裤子就掉了啦 ———"
@@ -113,21 +136,34 @@ Page({
})
}, 1400)
}
},
onLoad: function (options) {

this.mallSync()
Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
this.setData({
shopList: res.data,
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId
});
console.log(this.data.shopList, 'list');
if (!tt.getStorageSync('mallTenantId') && res.data.length > 1) {
tt.setStorageSync('mallTenantId', res.data[0].tenantId)
tt.setStorageSync('mallIndex', 0)
}
}).catch(err => {
console.log(err, 'err');
})
},
onReachBottom(){//触底
onReachBottom() { //触底
console.log(111);
this.setData({
pageNum:this.data.pageNum+1
pageNum: this.data.pageNum + 1
})
this.getList()
},
onShow:function(){
},
onShow: function () {
this.getList()
}
}
})

+ 16
- 4
pages/couponorder/index/index.ttml 查看文件

@@ -2,7 +2,7 @@
<!-- <navbar back home text="我的券包" background='#fff' color="#000"></navbar>
<view style="height:{{navigationBarHeight}} "></view> -->

<view class="boatBoxf" >
<view class="boatBoxf">
<view class="boatBox">
<view class="boatItemBox" tt:for="{{boatLsit}}" tt:key="index" bindtap="setBoatFlag" data-index="{{index}}">
<view class="{{boatFlag==item.value? 'boatTitleA':'boatTitle'}}">{{item.name}}</view>
@@ -12,6 +12,18 @@
</view>
<view style="height:90rpx "></view>

<view class="picker" tt:if="{{shopList.length>1}}">
<picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{shopList}}" range-key="name"
disabled="{{false}}">
<view class="inside">
<view class="picker_item">
{{shopList[index].name}}
</view>
<image class="img" src="/assets/itemImg/filter.png"></image>
</view>
</picker>
</view>

<view class="ticketList" tt:for="{{list}}" tt:key="{{index}}">
<view class="ticketItem">
<view class="shopImg">
@@ -23,11 +35,11 @@
</view>
</view>
<navigator class="useBtn" tt:if="{{item.couponOrderStatus==0}}"
url="/pages/couponorder/detail/index?quancode={{item.id}}&couponorderstatus={{boatFlag}}&validStatus={{item.validStatus}}"
url="/pages/couponorder/detail/index?quancode={{item.id}}&couponorderstatus={{boatFlag}}&validStatus={{item.validStatus}}&mallTenantId={{item.tenantId}}"
hover-class="navigator-hover" open-type="navigate">去使用</navigator>
<navigator class="nouseBtn"
tt:if="{{item.couponOrderStatus==1||item.couponOrderStatus==2||item.couponOrderStatus==3}}"
url="/pages/couponorder/detail/index?quancode={{item.id}}&couponorderstatus={{boatFlag}}&validStatus={{item.validStatus}}"
url="/pages/couponorder/detail/index?quancode={{item.id}}&couponorderstatus={{boatFlag}}&validStatus={{item.validStatus}}&mallTenantId={{item.tenantId}}"
hover-class="navigator-hover" open-type="navigate">查看</navigator>

</view>
@@ -42,4 +54,4 @@
</view>
</view>

<tabbar tt:if="{{ifshowtab}}"/>
<tabbar tt:if="{{ifshowtab}}" />

+ 198
- 162
pages/couponorder/index/index.ttss 查看文件

@@ -1,66 +1,95 @@
.boatBoxf{
.boatBoxf {
width: 100%;
height: 90rpx;
position: fixed;
top: 0;
left: 0;
}
.boatBox{

width: 100%;
height: 90rpx;
display: flex;
justify-content: space-around;
background-color: #fff;
}
.boatTitle{
font-size: 30rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #999;
}
.boatTitleA{
font-size: 32rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-weight: 500;

}
.boatA{
width: 80rpx;
height: 6rpx;
background-color: #fb3e5c;
margin: 0 auto;
border-radius: 20rpx;
}
.ticketList{
width: 90%;
margin: 20rpx auto ;
overflow: hidden;
}
.ticketItem{
float: left;
background-color: #fff;
border-radius: 20rpx;
width: 80%;
height: 140rpx;
overflow: hidden;
}
.useBtn{
float: left;
border-radius: 20rpx;
width: 20%;
height: 140rpx;
line-height: 140rpx;
text-align: center;
color: #FFFFFF;
font-size: 30rpx;
background: linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%)
}
.nouseBtn{

.boatBox {

width: 100%;
height: 90rpx;
display: flex;
justify-content: space-around;
background-color: #fff;
}

.boatTitle {
font-size: 30rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #999;
}

.boatTitleA {
font-size: 32rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-weight: 500;

}

.picker {
margin-top: 25rpx;
padding: 17rpx 45rpx;
margin-bottom: 15rpx;
background-color: #fff;
}

.picker .inside {
display: flex;
justify-content: space-between;
}

.picker .inside .picker_item {
font-size: 35rpx;
}

.picker .inside .img {
width: 40rpx;
height: 40rpx;
}

.boatA {
width: 80rpx;
height: 6rpx;
background-color: #fb3e5c;
margin: 0 auto;
border-radius: 20rpx;
}

.ticketList {
width: 90%;
margin: 20rpx auto;

overflow: hidden;
}

.ticketItem {
float: left;
background-color: #fff;
border-radius: 20rpx;
width: 80%;
height: 140rpx;
overflow: hidden;
}

.useBtn {
float: left;
border-radius: 20rpx;
width: 20%;
height: 140rpx;
line-height: 140rpx;
text-align: center;
color: #FFFFFF;
font-size: 30rpx;
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%)
}

.nouseBtn {
float: left;
border-radius: 20rpx;
width: 20%;
@@ -72,122 +101,129 @@
background: #CECECE;

}
.shopImg{
width: 88rpx;
height: 88rpx;
border: 1px solid #f8f8f8;
border-radius: 50rpx;
margin-left: 20rpx;
margin-top: 30rpx;
float: left;

.shopImg {
width: 88rpx;
height: 88rpx;
border: 1px solid #f8f8f8;
border-radius: 50rpx;
margin-left: 20rpx;
margin-top: 30rpx;
float: left;
}
.shopImg image{

.shopImg image {
width: 100%;
height: 100%;
border: 1px solid #f8f8f8;
border-radius: 50rpx;
}
.ticketData{
margin-left: 20rpx;
overflow: hidden;
float: left;

.ticketData {
margin-left: 20rpx;
overflow: hidden;
float: left;
}
.ticketTitle{
font-size: 32rpx;
margin-top: 30rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 270rpx;

.ticketTitle {
font-size: 32rpx;
margin-top: 30rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 270rpx;

}

.date{
font-size: 22rpx;
margin-top: 10rpx;
.date {
font-size: 22rpx;
margin-top: 10rpx;
}
.date::before{
content: "有效期至:";
font-size: 26rpx;

.date::before {
content: "有效期至:";
font-size: 26rpx;
}

.loading {
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #999;
}
.loading image {
width: 60rpx;
height: 60rpx;
vertical-align: middle;
margin-right: 10rpx;
}

.dingdan {
margin-top: 33rpx;
}
.dingdan text:nth-of-type(1) {
display: block;
font-size: 34rpx;
color: #333;
letter-spacing: 0;
text-align: center;
}
.dingdan text:nth-of-type(2) {
display: block;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
text-align: center;
}
.dingdan image {
display: block;
width: 300rpx;
height: 300rpx;
margin: 0 auto 16rpx;
}
.wait{
display: inline-block;
width: 123rpx !important;
overflow: visible!important;
font-size: 28rpx;
color: #FD832D;
letter-spacing: 0;
text-align: right;
line-height: 28rpx!important;
float: right;
margin: 20rpx;
}

.sucess {
display: inline-block;
width: 123rpx !important;
/* overflow: hidden; */
font-family:PingFangSC-Regular;
font-size: 28rpx;
font-weight:400;
color: #2C8DFF;
letter-spacing: 0;
text-align: right;
line-height: 26px;
float: right;
margin: 20rpx;
}
.close {
display: inline-block;
width: 123rpx !important;
overflow: hidden;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
text-align: right;
line-height: 28rpx;
float: right;
margin: 20rpx;
}
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 26rpx;
color: #999;
}

.loading image {
width: 60rpx;
height: 60rpx;
vertical-align: middle;
margin-right: 10rpx;
}

.dingdan {
margin-top: 33rpx;
}

.dingdan text:nth-of-type(1) {
display: block;
font-size: 34rpx;
color: #333;
letter-spacing: 0;
text-align: center;
}

.dingdan text:nth-of-type(2) {
display: block;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
text-align: center;
}

.dingdan image {
display: block;
width: 300rpx;
height: 300rpx;
margin: 0 auto 16rpx;
}

.wait {
display: inline-block;
width: 123rpx !important;
overflow: visible !important;
font-size: 28rpx;
color: #FD832D;
letter-spacing: 0;
text-align: right;
line-height: 28rpx !important;
float: right;
margin: 20rpx;
}

.sucess {
display: inline-block;
width: 123rpx !important;
/* overflow: hidden; */
font-family: PingFangSC-Regular;
font-size: 28rpx;
font-weight: 400;
color: #2C8DFF;
letter-spacing: 0;
text-align: right;
line-height: 26px;
float: right;
margin: 20rpx;
}

.close {
display: inline-block;
width: 123rpx !important;
overflow: hidden;
font-size: 28rpx;
color: #999;
letter-spacing: 0;
text-align: right;
line-height: 28rpx;
float: right;
margin: 20rpx;
}

+ 16
- 12
pages/edit/edit.ttml 查看文件

@@ -9,20 +9,20 @@
<view class="section sec">
<text>生日</text>
<picker mode="date" value="{{date}}" start="1930-09-01" end="{{dateEnd}}" bindchange="bindDateChange">
<input tt:if="{{flag==1}}" class='input' placeholder='请输入生日' disabled/>
<input tt:if="{{flag==1}}" class='input' placeholder='请输入生日' disabled />
<view tt:if="{{flag==2}}" class="picker"> {{date}}</view>
</picker>
<image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
</view>
<view class='section'>
<text>身高</text>
<input tt:if="{{height}}" name="height" type="text" placeholder="请填写身高单位cm" placeholder='{{height}}'/>
<input tt:if="{{height}}" name="height" type="text" placeholder='{{height||' 请填写身高单位cm'}}' />
<input tt:if="{{!height}}" name="height" type="text" placeholder="请填写身高单位cm" />
</view>
<view class='section'>
<text>体重</text>
<input tt:if="{{weight}}" name="weight" type="text" placeholder="请填写体重单位kg" placeholder='{{weight}}'/>
<input tt:if="{{!weight}}" name="weight" type="text" placeholder="请填写体重单位kg" />
<input tt:if="{{weight}}" name="weight" type="text" placeholder='{{weight||' 请填写体重单位kg'}}' />
<input tt:if="{{!weight}}" name="weight" type="text" placeholder="请填写体重单位kg" />
</view>
<view class="section section_gap">
<text>性别</text>
@@ -33,7 +33,7 @@
</radio-group>
</view>

<view class='address sec' bindtap='address'>
<text>住址</text>
<view class='names' tt:if="{{address}}">{{address}}</view>
@@ -46,14 +46,16 @@
<view class="contBox">
<view class='contBox_section'>
<text>姓名</text>
<input tt:if="{{item.name}}" type="text" placeholder='{{item.name}}' bindinput="chidName" data-index="{{index}}" />
<input tt:if="{{item.name}}" type="text" placeholder='{{item.name}}' bindinput="chidName"
data-index="{{index}}" />
<input tt:if="{{!item.name}}" type="text" placeholder='请填写名字' bindinput="chidName" data-index="{{index}}" />
</view>

<view class="contBox_section sec">
<text>生日</text>
<picker class="contBox_picker" mode="date" value="{{date}}" start="1930-09-01" end="{{dateEnd}}" bindchange="chidBirthday" data-index="{{index}}">
<input tt:if="{{!item.birthdate}}" class='contBox_picker' placeholder='请输入生日' disabled/>
<picker class="contBox_picker" mode="date" value="{{date}}" start="1930-09-01" end="{{dateEnd}}"
bindchange="chidBirthday" data-index="{{index}}">
<input tt:if="{{!item.birthdate}}" class='contBox_picker' placeholder='请输入生日' disabled />
<view tt:if="{{item.birthdate}}" class="contBox_picker"> {{item.birthdate}}</view>
</picker>
<image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
@@ -62,10 +64,10 @@
<view class="contBox_section section_gap">
<text>性别</text>
<radio-group class="radio-group" bindchange="childSex" data-index="{{index}}">
<radio class="radio" value="1" checked="{{item.sex==1?true:false}}">
<radio class="radio" value="1" checked="{{item.sex==1?true:false}}">
<text>男</text>
</radio>
<radio class="radio" value="2" checked="{{item.sex==2?true:false}}">
<radio class="radio" value="2" checked="{{item.sex==2?true:false}}">
<text>女</text>
</radio>
</radio-group>
@@ -75,6 +77,8 @@
<view class="det_child_box" bindtap="childDel" data-index="{{index}}"> 删除</view>

</view>
<button class='btn' tt:if="{{!username}}" formType="submit" hover-class='active' style='background: linear-gradient(270deg, #DDAB5A, #B8832D)'>完成</button>
<button class='btn' tt:if="{{username}}" formType="submit" hover-class='active' style='background: linear-gradient(270deg, #DDAB5A, #B8832D);'>完成</button>
<button class='btn' tt:if="{{!username}}" formType="submit" hover-class='active'
style='background: linear-gradient(270deg, #DDAB5A, #B8832D)'>完成</button>
<button class='btn' tt:if="{{username}}" formType="submit" hover-class='active'
style='background: linear-gradient(270deg, #DDAB5A, #B8832D);'>完成</button>
</form>

+ 18
- 16
pages/getPhone/getPhone.js 查看文件

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

onLoad: function (options) {
var that = this;
console.log(options.skipUrl, "options.skipUrl")
if (options.skipUrl) {
that.setData({
skipUrl: options.skipUrl
})
}

if (options.mallTenantId) {
that.setData({
mallTenantId: options.mallTenantId
})
}
that.setData({
path: options.path
})
@@ -44,7 +46,7 @@ Page({
});
}

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

@@ -122,11 +124,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 +139,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 +163,7 @@ Page({
url: app.globalData.skipUrl,
})
return;
}else if (app.globalData.skip == 'navigateBack') {
} else if (app.globalData.skip == 'navigateBack') {
tt.navigateBack({
delta: 1,
})
@@ -229,7 +231,7 @@ Page({
})
} else if (that.data.path == 'index' && that.data.paramData.cuserId) {
tt.redirectTo({
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate
url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate + "&mallTenantId=" + that.data.mallTenantId,
})
}
/**
@@ -251,10 +253,10 @@ 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"
url: "/pages/coupon/detail/index?couponChannelId=" + that.data.couponChannelId + "&flag=pay" + "&mallTenantId=" + that.data.mallTenantId,
})
} else {
tt.redirectTo({


+ 271
- 251
pages/getuserinfo/getuserinfo.js 查看文件

@@ -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,28 @@ 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
})
}
// 来自优惠券详情页面
@@ -126,8 +125,22 @@ Page({
}
//确定订单
if (options && options.confirmationFlag) {
if (options.mallTenantId) {
that.setData({
confirmationFlag: options.confirmationFlag,
mallTenantId: options.confirmationFlag
})
} else {
that.setData({
confirmationFlag: options.confirmationFlag
})
}

}
// 我的
if (options && options.mineFlag) {
that.setData({
confirmationFlag: options.confirmationFlag
mineFlag: options.mineFlag
})
}
//调查问卷
@@ -184,18 +197,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 +259,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}&mallTenantId=${that.data.mallTenantId}`,
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,9 +509,9 @@ Page({
mask: false
});
})
}).catch(err=>{
console.log(err);
}).catch(err => {
console.log(err, 'getUserInfo');
tt.showModal({
title: '提示',
showCancel: false,
@@ -508,11 +528,11 @@ Page({
}
});
})
}),
});


},
@@ -524,16 +544,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: '提示',


+ 26
- 25
pages/index/index.js 查看文件

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

const Http = require("../../utils/HttpBasics");
const imgurl = require("../../utils/imgurl");
const config = require("../../config/config");
@@ -7,8 +6,7 @@ Page({
/**
* 页面的初始数据
*/
data: {
},
data: {},
/**
* 生命周期函数--监听页面加载
*/
@@ -55,6 +53,7 @@ Page({
app.globalData.type = options.type;
if (options.type == 'cd') {
options.couponChannelId = this.data.newArr[2];
options.tenantId = this.data.newArr[3];
} else if (options.type == 'bd') {
options.bt = this.data.newArr[2];
options.id = this.data.newArr[3];
@@ -78,6 +77,8 @@ Page({
options.id = this.data.newArr[2];
} else if (options.type == 'ts') {
options.id = this.data.newArr[2];
} else if (options.type == 'ts') {
options.id = this.data.newArr[2];
}
}
}
@@ -109,7 +110,7 @@ Page({
}
}
},
getCongig() {//获取小程序是否开通授权手机号
getCongig() { //获取小程序是否开通授权手机号
Http.get({
url: config.api.getConfig,
data: {
@@ -135,8 +136,8 @@ Page({
}
},
/**
* 获取手机信息
*/
* 获取手机信息
*/
updateUserInfo() {
tt.getSystemInfo({
success: function (res) {
@@ -154,25 +155,25 @@ Page({
checkuserstatus(options) {
let that = this;
console.log("判断是否是商品详情");
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 {
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
})
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
})
.then(res => {
// res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}')
//参与拼团
@@ -292,7 +293,7 @@ Page({
// 首页
else if (app.globalData.type == 'in') {
tt.reLaunch({
url: '/index/index'
url: `/index/index`
});
}
// 停车
@@ -463,7 +464,7 @@ Page({
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}`
@@ -587,16 +588,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: '提示',


+ 50
- 38
pages/index/searchbar/detail/index.js 查看文件

@@ -34,7 +34,7 @@ Page({
canvasScale: 1.0, // 画布放大的倍数,因为如果保存的是一倍的分享图片的话,分享图会有点虚。所以保存的时候,canvasScale设置为2.0,wxss 里面的left: 500%;打开注释。就可保存两倍的分享图
},
//关闭海报
closePoste: function() {
closePoste: function () {
this.setData({
showpost: false
})
@@ -47,14 +47,23 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
console.log(options, 'options');
let that = this;
if (options && options.id) {
this.setData({
id: options.id
});
that.getList(options.id);
that.getCouponList(options.id);
const tenantId = options.tenantId
if (tenantId) {
that.getList(options.id, tenantId);
that.getCouponList(options.id, tenantId);
tt.setStorageSync('mallTenantId', tenantId);
} else {
that.getList(options.id, options.mallTenantId);
that.getCouponList(options.id, options.mallTenantId);
}

this.setData({
currentTab: 0
})
@@ -63,7 +72,7 @@ Page({
/**
* 拨打电话
*/
phone: function(e) {
phone: function (e) {
let that = this;
tt.makePhoneCall({
phoneNumber: e.target.dataset.merchantlinkphone
@@ -72,7 +81,7 @@ Page({
/**
* 显示分享弹框
*/
showshare: function() {
showshare: function () {
this.setData({
isshare: true,
})
@@ -80,13 +89,13 @@ Page({
/**
* 隐藏分享弹框
*/
hidemodal: function() {
hidemodal: function () {
this.setData({
isshare: false,
})
},
//滑动切换
swiperTabView: function(e) {
swiperTabView: function (e) {
this.setData({
currentTab: e.detail.current
});
@@ -100,32 +109,32 @@ Page({
url: `/pages/canvas/index?merchantId=${this.data.id}`
})
}, */
showPoster: function() {
showPoster: function () {
//跳转到海报生成页
let that = this;
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res => {
tt.navigateTo({
url: `/pages/canvas/index?merchantId=${that.data.id}`
})
}).catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
tt.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster`
})
}
Http.get({
url: config.api.checkUserStatus,
data: {
token: app.globalData.token
}
}).then(res => {
tt.navigateTo({
url: `/pages/canvas/index?merchantId=${that.data.id}`
})
}).catch(err => {
console.log(err)
if (err.code == 11004) {
// 用户昵称未授权
tt.redirectTo({
url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster`
})

}
})

},
//点击切换
clickTab: function(e) {
clickTab: function (e) {
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
@@ -137,24 +146,25 @@ Page({
/**
* 获取商户详情
*/
getList: function(id) {
getList: function (id, mallTenantId) {
let that = this;
let data;
data = {
pageNum: that.data.page,
pageSize: 15,
id: id
id: id,
mallTenantId: mallTenantId
}
Http.get({
url: config.api.merchantList,
data: data
}).then(res => {
if (res.data.list.length==0){
if (res.data.list.length == 0) {
tt.showModal({
title: '提示',
content: '此商户已经停用',
confirmText: "返回",
showCancel:false,
showCancel: false,
success: function (res) {
if (res.confirm) {
tt.navigateBack({
@@ -185,7 +195,7 @@ Page({
* 获取商户活动信息 券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券 100.消费卡)
* 投放频道:(1.列表, 2.限时抢购, 3. banner图 4. 游戏 5.卡频道 6.砍价频道 7.拼团频道 8专题)
*/
getCouponList: function(id) {
getCouponList: function (id, mallTenantId) {
let that = this;
let data;
data = {
@@ -193,15 +203,17 @@ Page({
merchantId: id,
pageNum: that.data.page,
pageSize: 15,
mallTenantId: mallTenantId
}
Http.post({
url: config.api.listByMerchant,
data: data
}).then(res => {
console.log(res, 'res');
that.setData({
couponList: res.data.page.list,
})
// if (res.data && res.data.qrCode){
// that.setData({
// qrCode: res.data.qrCode,
@@ -220,16 +232,16 @@ Page({
/**
* 获取多商铺列表
*/
onShareAppMessage: function(res) {
onShareAppMessage: function (res) {
app.globalData.previewFlag = true
let that = this;
let shareObj = {
title: that.data.data.merchantName,
path: `/pages/index/index?id=${that.data.id}&frommd=md&type=md`,
success: function(res) {
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function(error) {
fail: function (error) {
if (res.errMsg == 'shareAppMessage:fail cancel') {} else if (res.errMsg == 'shareAppMessage:fail') {}
}
};


+ 80
- 47
pages/index/searchbar/detail/index.ttss 查看文件

@@ -1,16 +1,17 @@
@import "../../../../app.ttss";
page{

page {
background: #F4F5F9;
}
.index-slide, swiper-item
.index-slide-image {

.index-slide,
swiper-item .index-slide-image {
display: block;
width: 750rpx;
height: 450rpx;
margin: 0 auto;
overflow: hidden;
position: relative;
height: 450rpx;

}

.index-slide-view .dots {
@@ -46,7 +47,9 @@ page{
border-top-right-radius: 20rpx;
}

.merchant-brand, .merchant-shop, .merchant-phone {
.merchant-brand,
.merchant-shop,
.merchant-phone {
width: 100%;
background: #fff;
}
@@ -59,45 +62,54 @@ page{
text-overflow: ellipsis;
overflow: hidden;
}
.merchant-brand view:nth-child(1) text:nth-child(1){
font-size:32rpx;
font-family:PingFangSC-Regular;
font-weight:400;
color:rgba(60,60,60,1);

.merchant-brand view:nth-child(1) text:nth-child(1) {
font-size: 32rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
color: rgba(60, 60, 60, 1);
margin-top: 20rpx;
}
.merchant-shop text, .merchant-phone text {

.merchant-shop text,
.merchant-phone text {
font-size: 30rpx;
}
.merchant-shop .fl{

.merchant-shop .fl {
color: #A6A6A6;
}

.merchant-phone view {
color: #A6A6A6;
}
.merchant-activity view{

.merchant-activity view {
color: #333;
margin-top: 20rpx;
}

.merchant-activity view:nth-child(2) {
font-size: 26rpx;
display:flex;
flex-direction:column;
display: flex;
flex-direction: column;
}

.merchant-shop view:nth-child(2) {
font-size: 30rpx;
color: #A6A6A6;
line-height: 26rpx;
}

.merchant-activity view:nth-child(1) {
font-size:30rpx;
font-size: 30rpx;
}

.merchant-activity view:nth-child(2) text {
font-size:28rpx;
color:#919191;
letter-spacing:0;
line-height:45rpx;
font-size: 28rpx;
color: #919191;
letter-spacing: 0;
line-height: 45rpx;
}

.merchant-info {
@@ -120,27 +132,32 @@ page{
line-height: 22rpx;
margin-right: 10rpx;
}
.posi{
color: #FD832D!important;

.posi {
color: #FD832D !important;
}
.wz{

.wz {
color: #A6A6A6;
font-size: 24rpx;
}
.notes view{

.notes view {
color: #A6A6A6;
}

.merchant-brand {
border: none !important;
width: 92%;
margin: 0 auto 20rpx;
}

.merchant-brand view:nth-child(2) text:nth-child(1) {
margin-top: 20rpx;
font-size: 32rpx;
}

.title{
.title {
font-size: 26rpx;
color: #A6A6A6;
width: 530rpx;
@@ -149,13 +166,18 @@ page{
text-overflow: ellipsis;
overflow: hidden;
}
.merchant-shop,.merchant-phone,.merchant-activity{

.merchant-shop,
.merchant-phone,
.merchant-activity {
width: 92%;
margin: 0 auto;
}
.shopHr{

.shopHr {
margin-bottom: 20rpx;
}

.tabs-item.selected {
color: rgba(171, 149, 109, 0.8);
border-bottom: 2px solid rgba(171, 149, 109, 0.8);
@@ -200,12 +222,13 @@ page{
position: absolute;
bottom: 0;
left: 15%;
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%);
border-radius: 100px;
}

.fenxiang {
position: absolute;
right:0;
right: 0;
top: 27rpx;
display: flex;
flex-direction: column;
@@ -215,12 +238,14 @@ page{
width: 48rpx;
height: 48rpx;
margin: 0 auto;
}
.gift{
}

.gift {
color: #3C3C3C;
font-size: 20rpx;
margin: 0 auto;
}

.user-motto {
width: 270rpx;
border: 0;
@@ -260,21 +285,24 @@ page{
text-align: center;
color: #999;
}
.have{
text-align: left!important;

.have {
text-align: left !important;
}

.swiperactive {
min-height: 400rpx;
padding-bottom: 44rpx;
padding:0 4% 10rpx;
padding: 0 4% 10rpx;

}
.swiperactive image{

.swiperactive image {
display: block;
width: 300rpx;
margin: 30rpx auto 0;
}

.modal {
width: 100%;
height: 100%;
@@ -328,7 +356,7 @@ page{
top: 0;
left: 0;
/* left: 500%; 分享图不显示在页面上面,就将画布设置在页面之外*/
}
}

.dingdan image {
display: block;
@@ -336,20 +364,24 @@ page{
margin: 30rpx auto 0;
}

button::after{ border: none; }
.goback{
button::after {
border: none;
}

.goback {
position: fixed;
right: 20rpx;
bottom: 60rpx;
width:100rpx!important;
height:100rpx;
width: 100rpx !important;
height: 100rpx;
z-index: 100;
background:rgba(255,255,255,1);
background: rgba(255, 255, 255, 1);
line-height: 95rpx;
border:1rpx solid rgba(227,227,227,1);
border-radius:50%;
border: 1rpx solid rgba(227, 227, 227, 1);
border-radius: 50%;
}
.goback image{

.goback image {
position: absolute;
width: 60rpx;
left: 0;
@@ -358,8 +390,9 @@ button::after{ border: none; }
bottom: 0;
margin: auto;
}
.frHr{

.frHr {
float: left;
margin-left: 12rpx;
margin-top:18rpx;
margin-top: 18rpx;
}

+ 33
- 25
pages/integralmall/payIntegcoupondetail/index.js 查看文件

@@ -3,7 +3,9 @@ const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px';
var config = require("../../../config/config.js");
const Http = require("../../../utils/HttpBasics");
const imgurl = require("../../../utils/imgurl");
const { spellStatus } = require("../../../utils/spell");
const {
spellStatus
} = require("../../../utils/spell");
Page({

/**
@@ -20,25 +22,25 @@ Page({
data: null,
showErr: false,
showAlert: false,
remainingPoints:0,
submitAble:true
remainingPoints: 0,
submitAble: true
},
getUserInfo: function () {
let that = this;
// 获取用户信息
Http.get({
url: config.api.getScore,
data: {}
})
url: config.api.getScore,
data: {}
})
.then(res => {
console.log(res)
that.setData({
remainingPoints: Number(res.data.credit) - Number(that.data.data.creditPrice),
userInfo:res.data
userInfo: res.data
})
})
},
cannotPay(){
cannotPay() {
tt.showToast({
title: "您的积分不足",
image: './../../../assets/images/fail.png',
@@ -56,7 +58,7 @@ Page({
url: `/pages/spellGroup/spellGroup`,
})
},
onShow:function(){
onShow: function () {
this.setData({
submitAble: true
})
@@ -68,23 +70,28 @@ Page({
this.setData({
paramData: options
})
if (options.mallTenantId) {
this.setData({
mallTenantId: options.mallTenantId,
})
}
this.getDetail(options.couponChannelId);

// 关闭来自于左上角的分享
tt.hideShareMenu()
},
/**
* 发起支付
*/
* 发起支付
*/
gotoPay() {
var that = this;
that.setData({
submitAble: false
})
Http.get({
url: config.api.checkPhoneStatus,
data: {}
})
url: config.api.checkPhoneStatus,
data: {}
})
.then(res => {
var data = {
couponChannelId: "" + that.data.paramData.couponChannelId,
@@ -180,7 +187,7 @@ Page({
*/
tt.redirectTo({
url: "/pages/getphoneInfo/index?couponChannelId=" +
that.data.paramData.couponChannelId + "&couponId=" + that.data.paramData.couponId +"&path=jifen"
that.data.paramData.couponChannelId + "&couponId=" + that.data.paramData.couponId + "&path=jifen"
});
} else if (err.code == 11006) {
// 用户手机已加密
@@ -206,7 +213,7 @@ Page({
});
// console.log(that.data.type)
// 免费券
that.payOrderUpdate(orderId, "0", 1, '',that);
that.payOrderUpdate(orderId, "0", 1, '', that);
// that.payOrderUpdate(that.data.orderId, '', 1, '', that);
if (that.data.cardType == 100) {
tt.setStorage({
@@ -229,14 +236,15 @@ 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,
mallTenantId: this.data.mallTenantId || ''
}
})
.then(res => {
tt.hideLoading()
tt.navigateTo({
@@ -256,7 +264,7 @@ Page({
*/
getDetail(couponChannelId) {
let that = this;
Http.get({
Http.get({
url: config.api.couponDetail,
data: {
couponChannelId: couponChannelId


+ 32
- 18
pages/liveLsit/liveLsit.js 查看文件

@@ -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,17 @@ Page({
noDataFlag: false,
businePageNum: 1,
businessData: null,
Lsit:[],
Lsit: [],
mallTenantId: '',
},
goOrder(){
goOrder() {
tt.navigateTo({
url: '/pages/order/index/index',
success: (res) => {
},
fail: (res) => {
},
});
},
@@ -38,15 +41,16 @@ Page({
param = {
pageNum: this.data.businePageNum,
pageSize: 6,
targetAd: 101
targetAd: 101,
mallTenantId: this.data.mallTenantId
}
} else {
param = {
pageNum: this.data.businePageNum,
pageSize: 6,
business: key,
targetAd: 101
targetAd: 101,
mallTenantId: this.data.mallTenantId
}
}
Http.get({
@@ -60,8 +64,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({
@@ -101,15 +105,16 @@ Page({
param = {
pageNum: this.data.businePageNum,
pageSize: 6,
targetAd: 101
targetAd: 101,
mallTenantId: this.data.mallTenantId
}
} else {
param = {
pageNum: this.data.businePageNum,
pageSize: 6,
business: key,
targetAd: 101
targetAd: 101,
mallTenantId: this.data.mallTenantId
}
}
Http.get({
@@ -122,7 +127,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({
@@ -173,7 +178,8 @@ Page({
Http.get({
url: config.api.batchCouponPriceAndStock,
data: {
couponChannelIds: str
couponChannelIds: str,
mallTenantId: this.data.mallTenantId
}
}).then(res => {
console.log(JSON.parse(res.data));
@@ -203,15 +209,23 @@ Page({
})
},
goDetail(e) {
console.log(e, 'e');
let couponChannelId = e.currentTarget.dataset.id
let couponId = e.currentTarget.dataset.couponid
let mallTenantId = this.data.mallTenantId
tt.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&mallTenantId=${mallTenantId}`,
})
},
onLoad: function (options) {
app.globalData.ifCongPh = 1//固定写法 放在指定要手机号授权框出现
//固定写法 放在指定要手机号授权框出现
// app.globalData.ifCongPh = 1
this.getCouponChannelList()

tt.setStorageSync('mallTenantId', options.tenantId);
this.setData({
mallTenantId: options.tenantId
})
},
onReachBottom: function () {
console.log("我到底了")
@@ -219,7 +233,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)
},

+ 7
- 8
pages/liveLsit/liveLsit.ttml 查看文件

@@ -1,11 +1,10 @@
<!-- <navbar home text="直播商品"></navbar> -->
<!-- <view style="height:{{navigationBarHeight}};line-height: {{navLineHeight}}; " class="title">直播商品</view> -->
<!-- <view style="height:{{navigationBarHeight}};"></view> -->
<view class="LsitBox" >
<view class="LsitBox">
<view tt:for="{{Lsit}}" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}" class="wBox">
<view class="itemBox">
<view class="imgBox">
<view class="imgBox">
<image class="img" src="{{item.coverImg}}">
</image>
<view class="explain" tt:if="{{index==0}}">
@@ -13,7 +12,7 @@
<view class="explainTitle">讲解中</view>
</view>
<view class="num">{{index+1}}</view>
</view>
<view class="dataBox">
<view class="titleName">{{item.title}}</view>
@@ -35,9 +34,9 @@
</view>
</view>
</view>
</view>

<view class="upDataBox">
@@ -45,7 +44,7 @@
<image src="../../assets/images/goOder.png" class="goOrder"></image>
<view class="goOrderText">我的订单</view>
</view>
<view class="upData" bindtap="upDataLsit"> 点击刷新</view>
</view>
<view class="noDet" tt:if="{{noDataFlag}}">没有更多</view>

+ 332
- 301
pages/main/index.js 查看文件

@@ -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({
@@ -51,7 +50,7 @@ Page({
that.setData({
newArr: this.data.scene.split(':')
})
console.log(this.data.newArr);
//// 大屏-二维码-start
if (this.data.newArr[0] == 'JC') {
// 跳转券详情
@@ -66,9 +65,11 @@ Page({
app.globalData.type = options.type;
if (options.type == 'cd') {
options.couponChannelId = this.data.newArr[2];
options.tenantId = this.data.newArr[3] || "";
} else if (options.type == 'bd') {
options.bt = this.data.newArr[2];
options.id = this.data.newArr[3];
options.tenantId = this.data.newArr[4] || "";
} else if (options.type == 'gm') {
options.id = this.data.newArr[2];
} else if (options.type == 'sd') {
@@ -79,6 +80,7 @@ Page({
} else if (options.type == 'md') {
// 门店详情
options.id = this.data.newArr[2];
options.tenantId = this.data.newArr[3] || "";
} else if (options.type == 'ra') {
//活动详情
options.id = this.data.newArr[2];
@@ -86,9 +88,11 @@ 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];
} else if (options.type == 'scanIn') {
options.tenantId = this.data.newArr[2] || "";
}
}
}
@@ -102,7 +106,7 @@ Page({
if (options.couponChannelId || options.orderId || options.id) {
that.userStatus(options);
} else {
that.userStatus();
that.userStatus(options);
}
} else {
// 由于 token 是网络请求,可能会在 Page.onLoad 之后才返回
@@ -113,7 +117,7 @@ Page({
if (options.couponChannelId || options.orderId || options.id) {
that.userStatus(options);
} else {
that.userStatus();
that.userStatus(options);
}
}
}
@@ -122,12 +126,13 @@ Page({
/**
* 检查用户的状态
*/
userStatus: function(options) {
userStatus: function (options) {
var that = this;
console.log(options, 'userStatus');
if (options && (options.couponChannelId || options.orderId || options.id)) {
that.checkuserstatus(options);
} else {
that.checkuserstatus();
that.checkuserstatus(options);
}
},
/**
@@ -149,317 +154,146 @@ Page({
// },

checkuserstatus(options) {
console.log(options, 'checkuserstatus');
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 {
let dataX = {
token: app.globalData.token,
}

if (options && options.tenantId) {
dataX.mallTenantId = options.tenantId
}

console.log(dataX, 'dataX');
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,
dataX
})
.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}&mallTenantId=${options.tenantId}`
})
} 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}`
url: `/pages/index/searchbar/detail/index?id=${options.id}&tenantId=${options.tenantId}`
});
}
else if(app.globalData.type == 'wjLsit'){//问卷调查
// 参与砍价
else if (options && options.orderId) {
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}`,
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 +304,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 +375,7 @@ Page({
}
// 我的拼团
else if (app.globalData.type == 'ms') {
// 我的拼团
tt.redirectTo({
url: '/pages/spellGroup/spellGroup?from=myhtml'
})
@@ -558,29 +387,231 @@ 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') {
// 兑换
else if (app.globalData.type == 'zb') {
tt.redirectTo({
url: '/pages/liveLsit/liveLsit'
})
}
// 通过分享进入的门店详情
else if (options && options.id && options.frommd == 'md') {
tt.redirectTo({
url: `/pages/index/searchbar/detail/index?id=${options.id}`
});
}
// 通过扫码进入首页
else if (app.globalData.type == 'scanIn') {
console.log('scanIn!!!!!!!');
tt.navigateTo({
url: '/index/searchbar'
url: `/index/index?type=in&tenantId=${options.tenantId}`
})
} else {
console.log('/index/index');
// 主页
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 if (app.globalData.type == 'scanIn') {
tt.navigateTo({
url: `/index/index?type=in&tenantId=${options.tenantId}`
})
} 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 +629,7 @@ Page({
title: '提示',
content: err.message,
showCancel: false,
success: function(res) {
success: function (res) {
// 如果游戏下架或者找不到,重启首页
if (res.confirm) {
tt.reLaunch({


+ 196
- 100
pages/order/detail/index.js 查看文件

@@ -12,12 +12,13 @@ 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,
couponTenantId: '',
showhieRq: false,
mouldType: 0,
showFlag: false,
@@ -50,20 +51,34 @@ Page({
cardIf: false,
contentType: 0,
orderFlag: false, //判断是不是线上配送
tenantId: '',
mallList: []
},
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);
});
@@ -130,9 +145,51 @@ Page({
})
},

getCouponMerchant() { //获取适用门店
Http.get({
url: config.api.orderDetail,
data: {
orderId: this.data.orderId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
const couponChannelId = res.data.orders[0].couponChannelId
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
let i = 0
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: false
}
if (i == 0) {
obj.expand = true
}
mallList.push(obj)
i++
})
this.setData({
mallList: mallList
})
})
}).catch(err => {

})
},

goDetail() {
tt.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${this.data.order.couponChannelId}`,
url: `/pages/coupon/detail/index?couponChannelId=${this.data.order.couponChannelId}&mallTenantId=${this.data.mallTenantId}`,
success: (res) => {

},
@@ -141,15 +198,16 @@ Page({
},
});
},
refund() {//退款
refund() { //退款
Http.post({
url: config.api.refund,
data: {
orderId: this.data.order.id
orderId: this.data.order.id,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
tt.navigateTo({
url: `/pages/refund/refund?id=${this.data.order.id}`,
url: `/pages/refund/refund?id=${this.data.order.id}&mallTenantId=${this.data.mallTenantId}`,
success: (res) => {

},
@@ -186,9 +244,9 @@ 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}`,
url: `/pages/refund/refund?id=${this.data.order.id}&mallTenantId=${this.data.mallTenantId}`,
success: (res) => {

},
@@ -209,10 +267,16 @@ Page({
Http.get({
url: url,
data: {
orderId: this.data.orderId
orderId: this.data.orderId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
tt.hideLoading();
if (res.data.tenantId) {
that.setData({
tenantId: res.data.tenantId
})
}
var createDate = util.formatTime(res.data.orders[0].createDate, "yyyy-MM-dd");
let tempData = res.data.orders[0]
tempData.deliveryInfo = tempData.deliveryInfo ? JSON.parse(tempData.deliveryInfo) : ""
@@ -294,7 +358,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 +366,30 @@ 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,
mallTenantId: this.data.mallTenantId || ''
}
}).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 +404,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 +457,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,22 +505,25 @@ Page({
_this.setData({
showhieRq: false,
})
Http.get({//获取动态二维码
Http.get({ //获取动态二维码
url: config.api.dynamicId,
data: {
couponOrderId: _this.data.order.couponOrderId
couponOrderId: _this.data.order.couponOrderId,
couponTenantId: _this.data.tenantId || ''
}
}).then(res => {
console.log(res, "res")
_this.setData({
dynamicRq: res.data.dynamicId,
expiredSeconds: res.data.expiredSeconds
expiredSeconds: res.data.expiredSeconds,
couponTenantId: res.data.couponTenantId
})

let url = JSON.stringify({
END: "C",
TYPE: "couponorder",
ID: _this.data.dynamicRq
ID: _this.data.dynamicRq,
couponTenantId: _this.data.couponTenantId
})
if (res.data.expiredSeconds == 0) {
//倒计时为零直接显示券码
@@ -541,20 +609,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 +631,9 @@ Page({
let _this = this
tt.rateAwemeOrder({
orderId: _this.data.payOrderNo,
success({ result }) {
success({
result
}) {
console.log(result);
if (result) {
tt.navigateBack({
@@ -591,12 +661,15 @@ Page({
Http.get({
url: config.api.getchanId,
data: {
id: _this.data.order.couponOrderId
id: _this.data.order.couponOrderId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
tt.canRateAwemeOrders({
orderIds: [res.data.payOrderNo],
success({ result }) {
success({
result
}) {
console.log("result", result);
_this.setData({
evaluateFlag: result[0],
@@ -619,6 +692,12 @@ Page({
*/
onLoad: function (options) {
this.getSeUrl()
if (options.mallTenantId) {
this.setData({
mallTenantId: options.mallTenantId,
})
}

this.setData({
mouldType: app.globalData.mouldType
})
@@ -628,10 +707,9 @@ Page({
// }
that.setData({
orderId: options.orderId,

});
tt.hideShareMenu()
if (options.cardIf) {//转赠 展示不需
if (options.cardIf) { //转赠 展示不需
that.setData({
cardIf: true
})
@@ -640,8 +718,7 @@ Page({
title: "加载中"
});



this.getCouponMerchant() //获取可用商户
},
onShow: function () {
let that = this;
@@ -650,7 +727,7 @@ Page({
})
that.updetail()
},
getSeUrl() {//获取客服链接
getSeUrl() { //获取客服链接
const openId = tt.getStorageSync('openId');
Http.post({
url: config.api.getServiceUrl,
@@ -686,16 +763,16 @@ 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}`
url: `/pages/spellDetail/index?orderId=${orderId}&couponId=${_this.data.order.productId}&orderGroupId=${res.data.orderGroupId}&mallTenantId=${this.data.mallTenantId}`
});
})
.catch(err => {
@@ -719,7 +796,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({
@@ -727,13 +804,12 @@ Page({
data: {
// composeOrderId: outOrderNo
orderId: outOrderNo,
composeOrderType: that.data.composeOrderType
composeOrderType: that.data.composeOrderType,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
if (res.data.createPay) {
let tempCallbackData = {
composeOrderId: res.data.outOrderNo
}
let tempCallbackData = res.data.callbackData
// tempCallbackData[that.data.data.couponChannel.ttSpuId] = that.data.data.couponChannel.id
let options = {
callbackData: tempCallbackData,
@@ -744,12 +820,24 @@ Page({
that.setData({
showbutton: false,
})
const { orderId, outOrderNo } = res;
// that.setData({ orderId, outOrderNo });
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 +885,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 +929,11 @@ Page({
icon: "none"
});
})
} else {//不支持支付2.0 js-api
} else { //不支持支付2.0 js-api
tt.showToast({
title: '请升级抖音', // 内容
icon: "none"
});
});
return
// 支付金额不为0
Http.post({
@@ -978,17 +1072,18 @@ Page({
/**
* 支付订单更新
*/
payOrderUpdate: (orderId, payOrderId, status, reason, type, _this) => {
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,
mallTenantId: this.data.mallTenantId || ''
}
})
.then(res => {
tt.hideLoading();
_this.setData({
@@ -1008,14 +1103,15 @@ Page({
tt.hideLoading();
}, 1600);
setTimeout(() => {
console.log('Here1');
let url = ""
if (_this.data.orderFlag) {
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${orderId}&dingdan=order`
url: `/pages/order/detail/index?orderId=${orderId}&dingdan=order}&mallTenantId=${that.data.mallTenantId}`
});
} else {
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${orderId}`
url: `/pages/order/detail/index?orderId=${orderId}}&mallTenantId=${that.data.mallTenantId}`
});
}

@@ -1023,8 +1119,9 @@ Page({
}
});
} else if (type == 'free') {
console.log('Here2');
tt.redirectTo({
url: `/pages/order/detail/index?orderId=${orderId}`
url: `/pages/order/detail/index?orderId=${orderId}}&mallTenantId=${that.data.mallTenantId}`
});
}
})
@@ -1047,5 +1144,4 @@ Page({
clearInterval(that.data.setInter);
clearInterval(that.data.templTiem);
},
});

});

+ 8
- 7
pages/order/detail/index.json 查看文件

@@ -1,9 +1,10 @@
{
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index"
}
}
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"usingComponents": {
"navbar": "../../../components/navbar/navbar",
"store": "../../../components/store/index",
"shop": "../../../components/shop/shop"
}
}

+ 169
- 158
pages/order/detail/index.ttml 查看文件

@@ -18,7 +18,7 @@
<text>{{order.title}}</text>
</view>
<!-- -->
<view class='detail_msg' bindtap="goDetail">
<view class='detail_msg' bindtap="goDetail">
<view class='logo'>
<image mode='aspectFill' src='{{order.coverImg}}'></image>
</view>
@@ -35,10 +35,12 @@
<text>下单时间:</text>{{createDate}}
</view>


<image class="infoArrow" src="{{chevronUrl}}" mode='widthFix'></image>
<view class="goRefund" catchtap="goRefund" data-id="{{order.id}}" tt:if="{{order.payment!=0&&(order.couponOrderStatus==0||order.couponOrderStatus==3)}}">{{order.couponOrderStatus==0?'申请退款':'退款进度'}}</view>
<view class="goRefund" catchtap="goRefund" data-id="{{order.id}}"
tt:if="{{order.payment!=0&&(order.couponOrderStatus==0||order.couponOrderStatus==3)}}">
{{order.couponOrderStatus==0?'申请退款':'退款进度'}}</view>
<!-- <pay-button
class="goRefund"
order-status="{{1}}"
@@ -47,209 +49,218 @@
bind:applyrefund="applyRefund"
/>
</view> -->
</view>
</view>
</view>

<view class="zhuangtai">
<image tt:if="{{order.couponOrderStatus==1}}" src="{{wm01Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==2}}" src="{{wm02Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==3}}" src="{{wm03Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==0&&order.validStatus==0}}" src="{{wm04Url}}" mode='widthFix'></image>
<view class="zhuangtai">
<image tt:if="{{order.couponOrderStatus==1}}" src="{{wm01Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==2}}" src="{{wm02Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==3}}" src="{{wm03Url}}" mode='widthFix'></image>
<image tt:if="{{order.couponOrderStatus==0&&order.validStatus==0}}" src="{{wm04Url}}" mode='widthFix'></image>

<view class="panel" tt:if="{{order.couponOrderStatus==0&&order.validStatus!=0}}">
<view class="canWrap">
<canvas canvas-id="qrcode" style="width: 1200rpx; height: 800rpx;" />
</view>
<image src="{{tempFilePath}}" mode="aspectFit" />
<view class="closeRq" tt:if="{{showhieRq}}" bindtap="setRq">
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image>
<view class="upDataRq">点一点刷新二维码</view>
</view>
<view class="coedTiem" tt:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
<view class="panel" tt:if="{{order.couponOrderStatus==0&&order.validStatus!=0}}">
<view class="canWrap">
<canvas canvas-id="qrcode" style="width: 1200rpx; height: 800rpx;" />
</view>
<image src="{{tempFilePath}}" mode="aspectFit" />
<view class="closeRq" tt:if="{{showhieRq}}" bindtap="setRq">
<image class="updataRqCode" mode='widthFix' src="{{upDataRqUrlF}}"></image>
<view class="upDataRq">点一点刷新二维码</view>
</view>
<view class="coedTiem" tt:if="{{!showhieRq&&expiredSeconds>1}}">二维码在
<text style="color:red">{{expiredSeconds}}s</text>
后失效
</view>
<!-- <view class="barnum buy"><text>兑换码:</text>{{code}}</view> -->
</view>
<!-- <view class="barnum buy"><text>兑换码:</text>{{code}}</view> -->
</view>

</view>
</view>




<view class='classif'>
<!--
<view class='classif'>
<!--
couponOrderStatus
0 未使用
1 已使用
2 已过期
3 已经退款
-->
<!--
<!--
orderStatus
1
只有支付完成的时
才显示兑换码
-->
<!-- bindtap="powerDrawer" -->
<view tt:if="{{order.orderStatus==1&&order.type!=100&&order.type!=5&&order.type!=51}}"
data-couponOrderStatus="{{order.couponOrderStatus}}" data-title="{{order.title}}"
data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.couponOrderId}}"
data-validstatus="{{order.validStatus}}" class='dhCode'>
<view style="width:86%;clear: both;">
<text class="fl">兑换码:</text>
<text class="fr" tt:if="{{order.validStatus!=0}}">{{showIdFalg?order.couponOrderId:order.couponOrderIdS}}</text>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
<view>
<!-- <image class="spcode" src="{{spcodeUrl}}" mode='widthFix'></image>
<!-- bindtap="powerDrawer" -->
<view tt:if="{{order.orderStatus==1&&order.type!=100&&order.type!=5&&order.type!=51}}"
data-couponOrderStatus="{{order.couponOrderStatus}}" data-title="{{order.title}}"
data-subtitle="{{order.subTitle}}" data-remark="{{order.remark}}" data-quancode="{{order.couponOrderId}}"
data-validstatus="{{order.validStatus}}" class='dhCode'>
<view style="width:86%;clear: both;">
<text class="fl">兑换码:</text>
<text class="fr"
tt:if="{{order.validStatus!=0}}">{{showIdFalg?order.couponOrderId:order.couponOrderIdS}}</text>
<image class="barnumImg" src="../../../assets/images/password.png" bindtap="showId"></image>
</view>
<view>
<!-- <image class="spcode" src="{{spcodeUrl}}" mode='widthFix'></image>
<image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image> -->
</view>
</view>
</view>

<view class='dhCode' bindtap="goPaySnapshoot" data-id="{{order.id}}" tt:if="{{(order.orderStatus!=0&&order.orderStatus!=2)}}">
<view style="width:86%;clear: both;">
<text class="fl">交易快照:可作为交易争执的判断依据</text>
<view class='dhCode' bindtap="goPaySnapshoot" data-id="{{order.id}}"
tt:if="{{(order.orderStatus!=0&&order.orderStatus!=2)}}">
<view style="width:86%;clear: both;">
<text class="fl">交易快照:可作为交易争执的判断依据</text>

</view>
<view>
<image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
</view>
</view>
<view>
<image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image>
</view>
</view>
<!-- <view>
<!-- <view>
<text>下单时间</text>
<text class='fr'>{{createDate}}</text>
</view> -->
<view class='dhCode'>
<text class='bianhao'>订单编号:</text>
<text>{{order.id}}</text>
</view>
<view class='wuliu' tt:if="{{order.type==11}}">
<text class='left'>物流状态:</text>
<text
class="right">{{(order.shippingStatus==10||order.shippingStatus==14)?"待自提":order.shippingStatus==15?"已自提":order.shippingStatus==20?"待发货":order.shippingStatus==24?"待收货":order.shippingStatus==25?"已收货":""}}</text>
</view>
<view class='wuliu' tt:if="{{order.shippingType==2&&order.deliveryInfo}}">
<text class='left'>物流公司:</text>
<text class="right">{{order.deliveryInfo.courierInput}}</text>
</view>
<view class='wuliu' tt:if="{{order.shippingType==2&&order.deliveryInfo}}">
<text class='left'>快递单号:</text>
<view class='dhCode'>
<text class='bianhao'>订单编号:</text>
<text>{{order.id}}</text>
</view>
<view class='wuliu' tt:if="{{order.type==11}}">
<text class='left'>物流状态:</text>
<text
class="right">{{(order.shippingStatus==10||order.shippingStatus==14)?"待自提":order.shippingStatus==15?"已自提":order.shippingStatus==20?"待发货":order.shippingStatus==24?"待收货":order.shippingStatus==25?"已收货":""}}</text>
</view>
<view class='wuliu' tt:if="{{order.shippingType==2&&order.deliveryInfo}}">
<text class='left'>物流公司:</text>
<text class="right">{{order.deliveryInfo.courierInput}}</text>
</view>
<view class='wuliu' tt:if="{{order.shippingType==2&&order.deliveryInfo}}">
<text class='left'>快递单号:</text>

<view class="left">{{order.deliveryInfo.expressageIdInput}}</view>
<view class="left">{{order.deliveryInfo.expressageIdInput}}</view>

<view class="copeCode" bindtap="copeCode" data-text="{{order.deliveryInfo.expressageIdInput}}">复制</view>
<text class="goInquire" bindtap="gokuaidi" data-nu="{{order.deliveryInfo.expressageIdInput}}">查询物流</text>
</view>
<view class="copeCode" bindtap="copeCode" data-text="{{order.deliveryInfo.expressageIdInput}}">复制</view>
<text class="goInquire" bindtap="gokuaidi" data-nu="{{order.deliveryInfo.expressageIdInput}}">查询物流</text>
</view>

<!-- <view>
<!-- <view>
<text tt:if="{{order.type == 8}}">原价</text>
<text tt:if="{{order.type != 8}}">面额</text>
<text class="jine1" tt:if="{{order.unit==0}}">{{order.price/100}}元</text>
<text class="jine1" tt:if="{{order.unit==1}}">{{order.price/100}}小时</text>
</view> -->
<view style="overflow: hidden; padding-left: 5%;padding-right: 5%;height: 96rpx;line-height: 96rpx;">
<text class='left'>实付金额:</text>
<view class='right'>
<text class='RMB'>¥</text>
<text class='jine'>{{order.payment/100}}</text>
<view style="overflow: hidden; padding-left: 5%;padding-right: 5%;height: 96rpx;line-height: 96rpx;">
<text class='left'>实付金额:</text>
<view class='right'>
<text class='RMB'>¥</text>
<text class='jine'>{{order.payment/100}}</text>
</view>
</view>
</view>
</view>
<!-- 适用门店 -->
<store merchantVoList="{{order.merchantVoList}}" tt:if="{{order.type!=12}}"></store>
<vieW class="groupTitleBox">
<view class="groupTitle" tt:if="{{order.itemGroup.length>0}}">团购详情</view>
</vieW>
<view class="groupTextBox" tt:if="{{order.itemGroup.length>0}}" tt:for="{{order.itemGroup}}">
<view class="groupTitleS" tt:if="{{item.group_name}}">{{item.group_name}}</view>
<view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi">
<view class="groupTiemBox">
<view class="yuandian"></view>
<view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view>
<view class="groupTiemPay">¥{{itemChi.price/100}}</view>
<!-- 适用门店 -->
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>
<vieW class="groupTitleBox">
<view class="groupTitle" tt:if="{{order.itemGroup.length>0}}">团购详情</view>
</vieW>
<view class="groupTextBox" tt:if="{{order.itemGroup.length>0}}" tt:for="{{order.itemGroup}}">
<view class="groupTitleS" tt:if="{{item.group_name}}">{{item.group_name}}</view>
<view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi">
<view class="groupTiemBox">
<view class="yuandian"></view>
<view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view>
<view class="groupTiemPay">¥{{itemChi.price/100}}</view>
</view>
</view>
</view>
</view>


<view class='notes'>
<view class="notesH">购买须知</view>
<view class="timeText">有效期</view>
<view class="Hchild">• {{order.validStartDate}}至{{order.validEndDate}}</view>
<view class="timeText">可用时间</view>
<view class="Hchild">• 商家营业时间内到店使用</view>
<view class="Hchild" tt:if="{{order.can_no_use_date.weekend}}">• 周末不支持使用</view>
<view class="Hchild" tt:if="{{order.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用</view>
<view class="timeText">购买限制</view>
<view class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</view>

<view class="timeText">预约消费</view>
<view class="Hchild" tt:if="{{!order.subscribeSing}}">• 无需预约,高峰时段可能等位</view>
<view class="Hchild" tt:if="{{order.subscribeSing}}">• {{order.subscribeSing}}</view>

<view class="timeText" tt:if="{{order.rec_person_num_max}}">适用人数</view>
<view class="Hchild" tt:if="{{order.rec_person_num_max}}">• 该团购劵最多{{order.rec_person_num_max}}人使用</view>

<view class="timeText">温馨提示</view>
<view class="Hchild">• 团购券不支持配送或外卖</view>
<view class="Hchild" tt:if="{{order.pack}}">• 该团购商品{{order.pack=='false'?'不支持':'支持'}}打包</view>
<view class="Hchild" tt:if="{{order.besides}}">• {{order.besides=="false"?'不可以':'可以'}}外带餐食</view>
<view class="Hchild" tt:if="{{order.superimposed_discounts}}">• {{order.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>
<view class="Hchild" tt:if="{{order.private_room}}">• {{order.private_room=="false"?'不可以使用':'可以使用'}}包间</view>

<view class="notesH" tt:if="{{order.curLsit}}">使用规则</view>

<view tt:if="{{order.curLsit}}" tt:for="{{order.curLsit}}" tt:key="{{index}}">
<view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view>
<text class="Hchild">{{item.content}}</text>
<view class='notes'>
<view class="notesH">购买须知</view>
<view class="timeText">有效期</view>
<view class="Hchild">• {{order.validStartDate}}至{{order.validEndDate}}</view>
<view class="timeText">可用时间</view>
<view class="Hchild">• 商家营业时间内到店使用</view>
<view class="Hchild" tt:if="{{order.can_no_use_date.weekend}}">• 周末不支持使用</view>
<view class="Hchild" tt:if="{{order.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用
</view>

<view class="timeText">购买限制</view>
<view class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</view>

<view class="timeText">预约消费</view>
<view class="Hchild" tt:if="{{!order.subscribeSing}}">• 无需预约,高峰时段可能等位</view>
<view class="Hchild" tt:if="{{order.subscribeSing}}">• {{order.subscribeSing}}</view>

<view class="timeText" tt:if="{{order.rec_person_num_max}}">适用人数</view>
<view class="Hchild" tt:if="{{order.rec_person_num_max}}">• 该团购劵最多{{order.rec_person_num_max}}人使用</view>

<view class="timeText">温馨提示</view>
<view class="Hchild">• 团购券不支持配送或外卖</view>
<view class="Hchild" tt:if="{{order.pack}}">• 该团购商品{{order.pack=='false'?'不支持':'支持'}}打包</view>
<view class="Hchild" tt:if="{{order.besides}}">• {{order.besides=="false"?'不可以':'可以'}}外带餐食</view>

<view class="Hchild" tt:if="{{order.superimposed_discounts}}">•
{{order.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>
<view class="Hchild" tt:if="{{order.private_room}}">• {{order.private_room=="false"?'不可以使用':'可以使用'}}包间</view>

<view class="notesH" tt:if="{{order.curLsit}}">使用规则</view>


<view tt:if="{{order.curLsit}}" tt:for="{{order.curLsit}}" tt:key="{{index}}">
<view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view>
<text class="Hchild">{{item.content}}</text>
</view>
</view>
</view>
<!-- 子券列表 -->
<view class="childList" tt:if="{{order.type==12}}">
<view class="childTitle">礼券:</view>
<view class="childItme" tt:for="{{order.giftCouponList}}" tt:key="{{item}}">
<view class="chaildDetBox">
<image mode='aspectFill' class="chaildImg" src="{{item.coverImg}}"></image>
<view class="childDataBox">
<view class="orderName">{{item.title}}</view>
<view class="childPriceStr">面额:{{item.priceStr}}元</view>
<!-- 子券列表 -->
<view class="childList" tt:if="{{order.type==12}}">
<view class="childTitle">礼券:</view>
<view class="childItme" tt:for="{{order.giftCouponList}}" tt:key="{{item}}">
<view class="chaildDetBox">
<image mode='aspectFill' class="chaildImg" src="{{item.coverImg}}"></image>
<view class="childDataBox">
<view class="orderName">{{item.title}}</view>
<view class="childPriceStr">面额:{{item.priceStr}}元</view>
</view>
</view>
</view>
</view>
</view>
<!-- 待付款 显示立即购买的按钮 -->
<view tt:if="{{(order.orderStatus==0&&order.salePrice!=0)||(order.orderStatus==7&&order.salePrice!=0)}}"
class="buy-view app-border-top">
<button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{orderFlag?order.composeOrderId:order.id}}"
disabled='{{showButton}}' class="{{mouldType!=1?'buy':'buyX'}}">立即支付</button>
</view>
<view class='game' bindtap="gotogame" tt-if="{{showIf&&order.orderStatus!=0}}">
<view class='game-entry'>
<image src="{{newUrl}}" class='gameimg' mode='widthFix'></image>
<!-- 待付款 显示立即购买的按钮 -->
<view tt:if="{{(order.orderStatus==0&&order.salePrice!=0)||(order.orderStatus==7&&order.salePrice!=0)}}"
class="buy-view app-border-top">
<button bindtap='orderFunc' hover-class='active'
data-couponChannelId="{{orderFlag?order.composeOrderId:order.id}}" disabled='{{showButton}}'
class="{{mouldType!=1?'buy':'buyX'}}">立即支付</button>
</view>
</view>
<!-- <button type="primary" open-type="share" tt:if="{{order.type == 100 && supportTransfer==1&&cardIf}}" class='support-tansfer'>
<view class='game' bindtap="gotogame" tt-if="{{showIf&&order.orderStatus!=0}}">
<view class='game-entry'>
<image src="{{newUrl}}" class='gameimg' mode='widthFix'></image>
</view>
</view>
<!-- <button type="primary" open-type="share" tt:if="{{order.type == 100 && supportTransfer==1&&cardIf}}" class='support-tansfer'>
<image src="{{weixinTitle}}" class='share' mode="widthFix"></image>转赠给微信好友</button> -->
<view class="sign"
tt:if="{{order.couponOrderStatus == 0 &&order.type == 11 && order.shippingType == 2 && order.shippingStatus== 24}}"
bindtap="setShow">签收
</view>
<view class="evaluate" bindtap="goEvaluate" tt:if="{{evaluateFlag}}">去评价</view>
<view class="explainText" tt:if="{{serviceUrl!=''&&(order.orderStatus==1||order.orderStatus==3||order.orderStatus==4||order.orderStatus==5)}}">对本订单有疑问或纠纷,请点击下方联系抖音官方客服</view>
<view class="serviceBox" tt:if="{{serviceUrl!=''&&(order.orderStatus==1||order.orderStatus==3||order.orderStatus==4||order.orderStatus==5)}}" bindtap="goWebView">
<image src="../../../assets/images/service1.png" class="serviceImg" ></image>
<view class="serviceText"> 抖音官方客服</view>
</view>
<view class="sign"
tt:if="{{order.couponOrderStatus == 0 &&order.type == 11 && order.shippingType == 2 && order.shippingStatus== 24}}"
bindtap="setShow">签收
</view>
<view class="evaluate" bindtap="goEvaluate" tt:if="{{evaluateFlag}}">去评价</view>
<view class="explainText"
tt:if="{{serviceUrl!=''&&(order.orderStatus==1||order.orderStatus==3||order.orderStatus==4||order.orderStatus==5)}}">
对本订单有疑问或纠纷,请点击下方联系抖音官方客服</view>
<view class="serviceBox"
tt:if="{{serviceUrl!=''&&(order.orderStatus==1||order.orderStatus==3||order.orderStatus==4||order.orderStatus==5)}}"
bindtap="goWebView">
<image src="../../../assets/images/service1.png" class="serviceImg"></image>
<view class="serviceText"> 抖音官方客服</view>
</view>

</view>
</view>


@@ -264,4 +275,4 @@
</view>
</view>
</view>
<!-- -->
<!-- -->

+ 158
- 124
pages/order/index/index.js 查看文件

@@ -6,7 +6,7 @@ let app = getApp();
const imgurl = require("../../../utils/imgurl");
Page({
data: {
showBox: false,//显示授权手机框
showBox: false, //显示授权手机框
navigationBarHeight,
noOrdersUrl: imgurl.noOrders.url,
loadingUrl: imgurl.loading.url,
@@ -15,21 +15,21 @@ Page({
wmgive: imgurl.wmgive.url,
boatFlag: "all",
tabs: [{
key: "all",
name: "全部"
},
{
key: 0,
name: "待付款"
},
{
key: 1,
name: "已完成"
},
{
key: 3,
name: "售后"
}
key: "all",
name: "全部"
},
{
key: 0,
name: "待付款"
},
{
key: 1,
name: "已完成"
},
{
key: 3,
name: "售后"
}
],
list: [],
current: "",
@@ -38,11 +38,21 @@ Page({
allow_load: true,
page: 1,
content: "",
canIUse: tt.canIUse("button.open-type.getPhoneNumber"),//判断小程序是否能用获取手机插件
ifshowtab:null,
canIUse: tt.canIUse("button.open-type.getPhoneNumber"), //判断小程序是否能用获取手机插件
ifshowtab: null,
shopList: [],
mallTenantId: tt.getStorageSync('mallTenantId') || '',
index: tt.getStorageSync('mallIndex') || 0
},

mallSync() {
this.setData({
mallTenantId: tt.getStorageSync('mallTenantId') || '',
index: tt.getStorageSync('mallIndex') || 0,
})
},

setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功
this.setData({
showBox: paramData.detail,
})
@@ -50,8 +60,7 @@ Page({
tt.showToast({
title: '授权成功', // 内容
icon: 'none', // 图标
success: (res) => {
},
success: (res) => {},
fail: (res) => {

},
@@ -74,18 +83,48 @@ Page({
});
},

bindPickerChange(e) {
const index = e.detail.value
const mallTenantId = this.data.shopList[index].tenantId
tt.setStorageSync('mallTenantId', mallTenantId)
tt.setStorageSync('mallIndex', index)
this.setData({
index: index,
mallTenantId: mallTenantId,
allow_load: true
});
console.log(this.data.mallTenantId);
this.getList(this.data.boatFlag, 1);
},

goback: function () {
tt.reLaunch({
url: '/index/index',
})
},


onLoad(e) {
// this.setData({
// current_scroll: e.id
// });
Http.get({
url: '/mall/subMall?isAll=1',
}).then(res => {
this.setData({
shopList: res.data,
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId
});
if (!tt.getStorageSync('mallTenantId') && res.data.length > 1) {
tt.setStorageSync('mallTenantId', res.data[0].tenantId)
tt.setStorageSync('mallIndex', 0)
}
console.log(this.data.shopList, 'list');

}).catch(err => {
console.log(err, 'err');
})
},
onShow() {
this.mallSync()
this.getList(this.data.boatFlag, 1);
Http.get({
url: config.api.checkUserStatus,
data: {
@@ -93,25 +132,22 @@ Page({
}
}).then(res => {
Http.get({
url: config.api.checkPhoneStatus,

}).then(res => {
}).catch(err => {
if (app.globalData.ifCongPh==1) {
url: config.api.checkPhoneStatus
}).then(res => {}).catch(err => {
if (app.globalData.ifCongPh == 1) {
app.globalData.skip = 'navigateBack'
tt.navigateTo({
url: `/pages/getPhone/getPhone?skipUrl=1`,
})
}else{
} else {
this.setData({
showBox:true
showBox: true
})
}

})
}).catch(err => {

if (err.code == 11004) {//未授权抖音
if (err.code == 11004) { //未授权抖音
app.globalData.type = 'mo'
tt.navigateTo({
url: '/pages/getuserinfo/getuserinfo',
@@ -119,13 +155,10 @@ Page({
});
}
})


this.setData({
ifshowtab : app.globalData.ifshowtab,
ifshowtab: app.globalData.ifshowtab,
allow_load: true
})
this.getList(this.data.boatFlag, 1);
},
/**
* 砍价中的状态
@@ -136,38 +169,38 @@ Page({
url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${e.currentTarget.dataset.id}`
})
},
cancel(e){//取消订单
cancel(e) { //取消订单
tt.showModal({
title: '提示',
content: '您是否要取消该订单',
confirmText: "确定",
success: (res) => {
if(res.confirm){
Http.post({
url:config.api.orderCancel,
data:{
orderId: e.currentTarget.dataset.id
}
}).then(res=>{
this.getList(this.data.boatFlag, 1);
tt.showToast({
title: "取消订单成功!",
icon: 'none',
duration: 2000,
mask: false
});
}).catch(err=>{
tt.showToast({
title: err.message?err.message:err.data,
icon: 'none',
duration: 2000,
mask: false
});
})
if (res.confirm) {
Http.post({
url: config.api.orderCancel,
data: {
orderId: e.currentTarget.dataset.id
}
}).then(res => {
this.getList(this.data.boatFlag, 1);
tt.showToast({
title: "取消订单成功!",
icon: 'none',
duration: 2000,
mask: false
});
}).catch(err => {
tt.showToast({
title: err.message ? err.message : err.data,
icon: 'none',
duration: 2000,
mask: false
});
})

} else if (res.cancel) {
console.log("取消");
}
} else if (res.cancel) {
console.log("取消");
}
},
fail(err) {
console.log(`showModal 调用失败`, err);
@@ -178,11 +211,11 @@ Page({
let level = e.currentTarget.dataset.level
if (level == 0) {
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'`
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&mallTenantId=${this.data.mallTenantId}&flag='pay'`
})
} else {
tt.navigateTo({
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&dingdan=order&flag='pay'`
url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&mallTenantId=${this.data.mallTenantId}&dingdan=order&flag='pay'`
})
}

@@ -211,18 +244,21 @@ Page({
* key==0
* 不发送该字段
*/
// const mallTenantId = tt.getStorageSync('mallTenantId')
if (key == 'all') {
var variable = {
pageNum: pageNum,
pageSize: 10,
paymentType: 0
paymentType: 0,
mallTenantId: that.data.mallTenantId
};
} else {
var variable = {
pageNum: pageNum,
pageSize: 10,
orderStatus: key,
paymentType: 0
paymentType: 0,
mallTenantId: that.data.mallTenantId
};
}

@@ -231,57 +267,56 @@ Page({
loading: true,
content: '小主,我在玩命加载中...'
})

Http.get({
url: config.api.orderList,
data: variable
}).then(res => {
if (pageNum >= res.data.pages) {
that.setData({
allow_load: false
});
url: config.api.orderList,
data: variable
}).then(res => {
if (pageNum >= res.data.pages) {
that.setData({
allow_load: false
});
setTimeout(function () {
that.setData({
loading: false,
})
}, 1400);
}
setTimeout(function () {
that.setData({
loading: false,
})
}, 1400);
}
setTimeout(function () {
that.setData({
loading: false,
})
}, 1400);
if (pageNum == 1) {
that.setData({
list: []
})
}
var tmpArr = that.data.list;
tmpArr.push.apply(tmpArr, res.data.list);
// 将砍价的状态过滤出来
console.log(tmpArr)
tmpArr.map(item => {
if (pageNum == 1) {
that.setData({
list: []
})
}
var tmpArr = that.data.list;
tmpArr.push.apply(tmpArr, res.data.list);
// 将砍价的状态过滤出来
console.log(tmpArr)
tmpArr.map(item => {

item.orders.map(itemChild => {
itemChild.createDate = util.formatTime(itemChild.createDate, "yyyy-MM-dd hh:mm:ss");
item.orders.map(itemChild => {
itemChild.createDate = util.formatTime(itemChild.createDate, "yyyy-MM-dd hh:mm:ss");
})
})
})

that.setData({
list: tmpArr
})
for (let i = 0; i < that.data.list.length; i++) {
var createDate1 = util.formatTime(that.data.list[i].createDate, "yyyy-MM-dd hh:mm:ss");
/**
* 修改list的endtime
* 渲染到页面
*/
var createDate = 'list[' + i + '].createDate'
that.setData({
[createDate]: createDate1
});
}
})
list: tmpArr
})
for (let i = 0; i < that.data.list.length; i++) {
var createDate1 = util.formatTime(that.data.list[i].createDate, "yyyy-MM-dd hh:mm:ss");
/**
* 修改list的endtime
* 渲染到页面
*/
var createDate = 'list[' + i + '].createDate'
that.setData({
[createDate]: createDate1
});
}
})
.catch(err => {
tt.showModal({
title: '提示',
@@ -289,8 +324,7 @@ Page({
showCancel: false
})
})
}
else {
} else {
that.setData({
loading: true,
content: "——— 再拉裤子就掉了啦 ———"
@@ -302,7 +336,7 @@ Page({
}, 1400)
}
},
handleChange({
handleChange({
detail
}) {
this.setData({
@@ -311,19 +345,19 @@ Page({
},

setBoatFlag(e) {
if (app.globalData.ifCongPh==1) {
let index = e.currentTarget.dataset.index
console.log(index);
this.setData({
boatFlag: index,
pageNum: 1,
allow_load: true,
})
this.getList(index, 1)
if (app.globalData.ifCongPh == 1) {
let index = e.currentTarget.dataset.index
console.log(index);
this.setData({
boatFlag: index,
pageNum: 1,
allow_load: true,
})
this.getList(index, 1)
} else {
this.setData({
showBox: true
})
this.setData({
showBox: true
})
}

},


+ 23
- 6
pages/order/index/index.ttml 查看文件

@@ -3,7 +3,7 @@
<view style="height:{{navigationBarHeight}} "></view> -->
<view class="market">

<view class="boatBoxf" >
<view class="boatBoxf">
<view class="boatBox">
<view class="boatItemBox" tt:for="{{tabs}}" tt:key="index" bindtap="setBoatFlag" data-index="{{item.key}}">
<view class="{{boatFlag==item.key?'boatTitleA':'boatTitle'}}">{{item.name}}</view>
@@ -12,7 +12,19 @@
</view>
</view>

<view style='padding-top:90rpx;'>
<view class="picker" tt:if="{{shopList.length>1}}">
<picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{shopList}}" range-key="name"
disabled="{{false}}">
<view class="inside">
<view class="picker_item">
{{shopList[index].name}}
</view>
<image class="img" src="/assets/itemImg/filter.png"></image>
</view>
</picker>
</view>

<view>
<view tt:for='{{list}}' tt:if="{{list.length!=0}}" class='section' tt:key='index'>
<view class='detail_top'>
<view>
@@ -36,8 +48,10 @@
<text class='close' tt:if="{{child.orderStatus==4}}">已退款</text>
<text class='wait' tt:if="{{child.orderStatus==5}}">退款失败</text>
<text class='sucess' tt:if="{{child.orderStatus==11}}">拼团成功</text>
<text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice==0&&child.type!=50&&child.type!=51}}">免费领取</text>
<text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice==0&&(child.type==50||child.type==51)}}">积分兑换</text>
<text class='sucess'
tt:if="{{child.orderStatus==1&&child.salePrice==0&&child.type!=50&&child.type!=51}}">免费领取</text>
<text class='sucess'
tt:if="{{child.orderStatus==1&&child.salePrice==0&&(child.type==50||child.type==51)}}">积分兑换</text>
<text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice!=0}}">付款成功</text>
</view>

@@ -55,7 +69,9 @@
<text>{{child.createDate}}</text>
</view>

<view tt:if="{{child.orderStatus!=0 && child.orderStatus!=7&&child.orderStatus!=5&&child.orderStatus!=6}}" class="btnZf" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" data-shipping="{{child.shippingType}}" bindtap="gotopay">
<view tt:if="{{child.orderStatus!=0 && child.orderStatus!=7&&child.orderStatus!=5&&child.orderStatus!=6}}"
class="btnZf" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}"
data-shipping="{{child.shippingType}}" bindtap="gotopay">
<text>去查看</text>
</view>
<view tt:if="{{child.orderStatus == 6}}" class="btn" data-id="{{child.id}}" bindtap="gotoDiscount">
@@ -66,7 +82,8 @@
<text>取消</text>
</view> -->

<view tt:if="{{child.orderStatus==0 || child.orderStatus==7}}" class="btnZf" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" bindtap="gotopay">
<view tt:if="{{child.orderStatus==0 || child.orderStatus==7}}" class="btnZf"
data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" bindtap="gotopay">
<text>去支付</text>
</view>
<view tt:if="{{child.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn">


+ 127
- 73
pages/order/index/index.ttss 查看文件

@@ -1,40 +1,64 @@
.boatBox {
width: 100% !important;
height: 96rpx;
display: flex;
justify-content: space-around;
background-color: #fff;
}

.boatBoxf {
width: 100% !important;
position: fixed;
top: 0;
left: 0;
z-index: 10000;
}

.boatTitle {
font-size: 30rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #999;
}

.boatBox{
width: 100% !important;
height: 96rpx;
display: flex;
justify-content: space-around;
background-color: #fff;
}
.boatBoxf{
width: 100% !important;
position: fixed;
top: 0;
left: 0;
z-index: 10000;
}
.boatTitle{
font-size: 30rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
color: #999;
}
.boatTitleA{
font-size: 32rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-weight: 500;
color: #d4a971;
}
.boatA{
.boatTitleA {
font-size: 32rpx;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-weight: 500;
color: #d4a971;
}

.boatA {
/* #fb3e5c */
width: 80rpx;
height: 6rpx;
background-color: #d4a971;
margin: 0 auto;
border-radius: 10rpx;
width: 80rpx;
height: 6rpx;
background-color: #d4a971;
margin: 0 auto;
border-radius: 10rpx;
}

.picker {
margin-top: 120rpx;
padding: 17rpx 45rpx;
margin-bottom: 28rpx;
background-color: #fff;
}

.picker .inside {
display: flex;
justify-content: space-between;
}

.picker .inside .picker_item {
font-size: 35rpx;
}

.picker .inside .img {
width: 40rpx;
height: 40rpx;
}


@@ -44,6 +68,7 @@
background: #F4F5F9;
margin-top: 20rpx;
}

.tabs {
position: fixed;
width: 100% !important;
@@ -61,10 +86,12 @@
width: 30% !important;
display: inline-block;
}
.section{

.section {
background: #FFFFFF;
overflow: hidden;
}

.detail_msg {
position: relative;
width: 92%;
@@ -75,7 +102,8 @@
padding-top: 20rpx;
/* border-bottom: 1rpx solid #eee; */
}
.sendImg{

.sendImg {
position: absolute;
width: 100rpx;
top: 100rpx;
@@ -96,13 +124,15 @@
height: 120rpx;
border-radius: 20rpx;
}
.detail_top{

.detail_top {
width: 100%;
height: 40rpx;
line-height: 40rpx;
font-size: 30rpx;
padding-top: 30rpx;
}

.detail_top view:nth-child(1) {
display: flex;
justify-content: space-between;
@@ -136,20 +166,21 @@
white-space: nowrap;
text-overflow: ellipsis;
}
.discount{

.discount {
position: absolute;
width: 100rpx;
top:86rpx;
right:2rpx;
top: 86rpx;
right: 2rpx;
}

.detail_top .sucess {
display: inline-block;
width: 123rpx !important;
/* overflow: hidden; */
font-family:PingFangSC-Regular;
font-family: PingFangSC-Regular;
font-size: 28rpx;
font-weight:400;
font-weight: 400;
color: #2C8DFF;
letter-spacing: 0;
text-align: right;
@@ -159,12 +190,12 @@
.wait {
display: inline-block;
width: 123rpx !important;
overflow: visible!important;
overflow: visible !important;
font-size: 28rpx;
color: #FD832D;
letter-spacing: 0;
text-align: right;
line-height: 28rpx!important;
line-height: 28rpx !important;
}

.close {
@@ -205,9 +236,11 @@
.info view:nth-child(3) {
margin-top: 16rpx;
}

.info view:nth-child(2) {
margin-top: 16rpx;
}

.payment {
position: relative;
width: 92%;
@@ -253,8 +286,9 @@
float: right;
font-size: 26rpx;
border-radius: 20rpx;
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%);
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%);
}

/* .btnZf{
position: absolute;
bottom: 0;
@@ -269,7 +303,7 @@
border-radius: 20rpx;
background:linear-gradient(130deg,rgba(50,177,252,1) 0%,rgba(47,108,255,1) 100%);
} */
.btnZf{
.btnZf {
position: absolute;
bottom: 0;
right: 0;
@@ -281,10 +315,11 @@
float: right;
font-size: 24rpx;
border-radius: 10rpx;
border: 1rpx solid #d4a971;
border: 1rpx solid #d4a971;
/* background:linear-gradient(130deg,rgba(50,177,252,1) 0%,rgba(47,108,255,1) 100%); */
}
.cancel{

.cancel {
position: absolute;
bottom: 0;
right: 120rpx;
@@ -296,9 +331,10 @@
float: right;
font-size: 24rpx;
border-radius: 10rpx;
border: 1rpx solid #d4a971;
border: 1rpx solid #d4a971;
}
.btnGm{

.btnGm {
position: absolute;
bottom: 0;
right: 0;
@@ -317,10 +353,12 @@
font-size: 26rpx;
color: #FFFFFF;
}
.txGm{
font-size: 26rpx!important;
color: #2C8DFF!important;

.txGm {
font-size: 26rpx !important;
color: #2C8DFF !important;
}

.dingdan {
margin-top: 33rpx;
}
@@ -362,20 +400,25 @@
vertical-align: middle;
margin-right: 10rpx;
}
button::after{ border: none; }
.goback{

button::after {
border: none;
}

.goback {
position: fixed;
right: 50rpx;
bottom: 60rpx;
width:100rpx!important;
height:100rpx;
width: 100rpx !important;
height: 100rpx;
z-index: 100;
background:rgba(255,255,255,1);
background: rgba(255, 255, 255, 1);
line-height: 95rpx;
border:1rpx solid rgba(227,227,227,1);
border-radius:50%;
border: 1rpx solid rgba(227, 227, 227, 1);
border-radius: 50%;
}
.goback image{

.goback image {
position: absolute;
width: 60rpx;
left: 0;
@@ -384,15 +427,18 @@ button::after{ border: none; }
bottom: 0;
margin: auto;
}
.itemBox{

.itemBox {
overflow: hidden;
margin: 0 50rpx 20rpx 50rpx;
padding-bottom: 20rpx;
position: relative;
}
.payStatus{

.payStatus {
text-align: right;
}

/* .payStatus .sucess {
display: inline-block;
width: 123rpx !important;
@@ -407,15 +453,16 @@ button::after{ border: none; }
.payStatus .sucess {
display: inline-block;
width: 123rpx !important;
font-family:PingFangSC-Regular;
font-family: PingFangSC-Regular;
font-size: 28rpx;
font-weight:400;
font-weight: 400;
color: #5cbb43;
letter-spacing: 0;
text-align: right;
line-height: 26px;
}
.itemImg{

.itemImg {
float: left;
display: block;
width: 120rpx;
@@ -423,31 +470,36 @@ button::after{ border: none; }
border: 1px solid #f8f8f8;
border-radius: 20rpx;
}

.itemImg image {
display: block;
width: 120rpx;
height: 120rpx;
border-radius: 20rpx;
}
.itemContent{

.itemContent {
float: left;
width: 70%;
}
.face{

.face {
font-size: 24rpx;
color: #999;
letter-spacing: 0;
padding-left: 4%;
line-height: 33rpx;
}
.face text{

.face text {
font-size: 24rpx;
color: #333;
letter-spacing: 0;
line-height: 33rpx;

}
.date{

.date {
/* margin-top: 16rpx; */
font-size: 24rpx;
color: #999;
@@ -456,7 +508,8 @@ button::after{ border: none; }
line-height: 26rpx;

}
.yunfe{

.yunfe {
font-size: 24rpx;
color: #999;
letter-spacing: 0;
@@ -464,7 +517,8 @@ button::after{ border: none; }
height: 33rpx;
line-height: 33rpx;
}
.yunfeK{

.yunfeK {
font-size: 24rpx;
color: #999;
letter-spacing: 0;


+ 58
- 58
pages/orderquanma/index.js 查看文件

@@ -39,20 +39,20 @@ Page({
getStaticGame(token) {
let _this = this;
Http.get({
url: config.api.getGame,
data: {
triggleAction: 4 // 核销触发
}
}).then(res => {
if (res.data.id) {
url: config.api.getGame,
data: {
triggleAction: 4 // 核销触发
}
}).then(res => {
if (res.data.id) {
_this.setData({
showIf: true
})
}
_this.setData({
showIf: true
staticGamedata: res.data
})
}
_this.setData({
staticGamedata: res.data
})
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -68,7 +68,7 @@ Page({
_this.setData({
showhieRq: false,
})
Http.get({//获取动态二维码
Http.get({ //获取动态二维码
url: config.api.dynamicId,
data: {
couponOrderId: _this.data.code
@@ -85,9 +85,9 @@ Page({
TYPE: "couponorder",
ID: _this.data.dynamicRq
})
if(res.data.expiredSeconds==0){
if (res.data.expiredSeconds == 0) {

}else{
} else {
let inre = setInterval(() => {
if (_this.data.expiredSeconds > 1) {
_this.setData({
@@ -106,17 +106,17 @@ Page({
templTiem: inre
})
}
// util.qrcode("qrcode", url, 350, 350);
_this.createQrCode(url, "qrcode", 350, 350);
}).catch(err => {
tt.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
}).catch(err => {
tt.showToast({
title: err.message,
icon: 'none',
duration: 2000,
mask: false
});
})
},

onLoad: function (options) { //quancode
@@ -134,11 +134,11 @@ Page({
validStatus: options.validstatus,
contentType: options.contentType
});
if (options.couponorderstatus==0){
that.setRq()//动态获取二维码 这个方法必须在拿到 options.quancode 后调用
if (options.couponorderstatus == 0) {
that.setRq() //动态获取二维码 这个方法必须在拿到 options.quancode 后调用
}
if (options.contentType != undefined && options.contentType==1) {
if (options.contentType != undefined && options.contentType == 1) {
this.setData({
curHtml: app.globalData.curHtml
})
@@ -149,28 +149,28 @@ Page({
that.data.setInter = setInterval(function () {
if (that.data.couponorderstatus == 0) {
Http.get({
url: config.api.getStatus,
data: {
couponOrderId: options.quancode
}
}).then(res => {
console.log(res);
that.setData({
couponorderstatus: res.data.CouponOrderStatus
});
if (res.data.CouponOrderStatus == 1) {
/**
* 动态改变上一级页面的核销状态
*/
that.getStaticGame()
var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
mystatus: res.data.CouponOrderStatus
url: config.api.getStatus,
data: {
couponOrderId: options.quancode
}
}).then(res => {
console.log(res);
that.setData({
couponorderstatus: res.data.CouponOrderStatus
});
}
})
if (res.data.CouponOrderStatus == 1) {
/**
* 动态改变上一级页面的核销状态
*/
that.getStaticGame()
var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage.setData({
mystatus: res.data.CouponOrderStatus
});
}
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -188,15 +188,15 @@ Page({
* 不需要循环
*/
Http.get({
url: config.api.getStatus,
data: {
couponOrderId: options.quancode
}
}).then(res => {
that.setData({
couponorderstatus: res.data.CouponOrderStatus
});
})
url: config.api.getStatus,
data: {
couponOrderId: options.quancode
}
}).then(res => {
that.setData({
couponorderstatus: res.data.CouponOrderStatus
});
})
.catch(err => {
tt.showToast({
title: err.errMsg,
@@ -237,4 +237,4 @@ Page({
// value: app.globalData.sight,
// })
// }
});
});

+ 60
- 30
pages/paySnapshoot/paySnapshoot.js 查看文件

@@ -6,7 +6,7 @@ const util = require("../../utils/util");
const imgurl = require("../../utils/imgurl");
Page({
data: {
isGetUser: true,//判断是否授权抖音
isGetUser: true, //判断是否授权抖音
mouldType: 0,
navigationBarHeight,
homeSelectedO: imgurl.homeSelectedO.url,
@@ -90,9 +90,9 @@ Page({
//图文混排
curHtml: '',
contentType: 0,
page: 1,//查询商户优惠券page
page: 1, //查询商户优惠券page
idList: [],
showBox: false,//手机号授权框
showBox: false, //手机号授权框
},

/**
@@ -104,7 +104,7 @@ Page({
})
},

setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功
setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功
this.setData({
showBox: paramData.detail,
})
@@ -200,9 +200,9 @@ Page({
let that = this;
// 获取用户信息
Http.get({
url: config.api.getScore,
data: {}
})
url: config.api.getScore,
data: {}
})
.then(res => {
console.log(res)
that.getQueryCardStatus()
@@ -223,9 +223,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)
})
@@ -248,9 +248,9 @@ Page({
receivedDisabled: true
})
Http.post({
url: config.api.cardAccept,
data: param
})
url: config.api.cardAccept,
data: param
})
.then(res => {
tt.showToast({
title: '领取成功!',
@@ -305,12 +305,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();
})
@@ -350,8 +350,7 @@ Page({
data: {
token: app.globalData.token
}
}).then(res => {
}).catch(err => {
}).then(res => {}).catch(err => {
if (err.code == 11004) {
this.setData({
isGetUser: false
@@ -440,11 +439,40 @@ Page({
that.getDetail(options.id, 'notendclock');

}
that.setData({
couponChannelId: options.id,
});
this.getCouponMerchant(options.id)
},
getCouponMerchant(couponChannelId) { //获取适用门店
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId
}
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
let i = 0
keys.forEach(item => {
const arr = item.split('|')
const obj = {
tenantId: arr[0],
mallName: arr[1],
merchantVoList: res.data[item],
expand: false
}
if (i == 0) {
obj.expand = true
}
mallList.push(obj)
i++
})
this.setData({
mallList: mallList
})
})
},
getHtml(couponChannelId) {
Http.get({
@@ -467,7 +495,9 @@ Page({
let that = this;
var parmer = {
url: config.api.getSnapshot,
data: {orderId:couponChannelId}
data: {
orderId: couponChannelId
}
};
Http.get(parmer)
.then(res => {
@@ -597,13 +627,13 @@ Page({
}


if(res.data.itemGroup){
if (res.data.itemGroup) {
let tempObj = that.data.data
tempObj.itemGroup = JSON.parse(tempObj.itemGroup)
that.setData({
data:tempObj
data: tempObj
})
console.log(that.data.data,"data");
console.log(that.data.data, "data");
}


@@ -612,7 +642,7 @@ Page({
tempObj.productAttrs = JSON.parse(tempObj.productAttrs)
tempObj.skuAttrs = JSON.parse(tempObj.skuAttrs)
tempObj.productAttrs.map(item => {
if (item.key == "appointment") {
let tempAppoinObj = JSON.parse(item.data)
if (tempAppoinObj.need_appointment) {
@@ -681,11 +711,11 @@ Page({
});
})
},


onShow() {
this.ifGetUser()//判断是否授权抖音
this.ifGetUser() //判断是否授权抖音
this.setData({
mouldType: app.globalData.mouldType,
showbutton: false,


+ 26
- 22
pages/paySnapshoot/paySnapshoot.ttml 查看文件

@@ -40,9 +40,9 @@
</view>
</view>
<text class='title'>{{data.title}}<text class="elecard" tt:if="{{data.type==100}}">电子卡</text></text>
<!-- 预购 -->
<view class="moneyBox" tt:if="{{data.type==10}}">
<view class="earnest">定金:</view>
@@ -73,7 +73,7 @@

</view>
<view class="fl" tt:if="{{data.type==8}}">
<text class="pri01">{{data.salePriceStr}}</text>
<text class='presslimit' tt:if="{{data.type==8}}"><text>{{data.pressLimitNum+'人可砍至底价'}}</text></text>
<text class='throgh'>{{data.priceStr}}元</text>
@@ -83,7 +83,7 @@

<view class="subTitleBox">
<text class="subTitle">{{data.subTitle}}</text>
</view>
</view>
</view>
@@ -98,12 +98,12 @@
<vieW class="groupTitleBox">
<view class="groupTitle" tt:if="{{data.itemGroup.length>0}}">团购详情</view>
</vieW>
<view class="groupTextBox" tt:if="{{data.itemGroup.length>0}}" tt:for="{{data.itemGroup}}">
<view class="groupTitleS">{{item.group_name}}</view>
<view class="groupDetailsBox" tt:for="{{item.item_list}}" tt:for-item="itemChi">
<view class="groupTiemBox" >
<view class="groupTiemBox">
<view class="yuandian"></view>
<view class="groupTiemName">{{itemChi.name}}({{itemChi.count}}份)</view>
<view class="groupTiemPay">¥{{itemChi.price/100}}</view>
@@ -111,47 +111,51 @@
</view>
</view>
<!-- 适用门店 -->
<store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store>
<!-- <store merchantVoList="{{merchantVoList}}" tt:if="{{data.type!=12}}"></store> -->
<shop tt:if="{{mallList.length>0}}" mallList="{{mallList}}"></shop>

<view class='notes'>
<view class="notesH">购买须知</view>
<view class="notesH">购买须知</view>
<view class="timeText">有效期</view>
<view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view>
<view class="timeText">可用时间</view>
<view class="Hchild">• 商家营业时间内到店使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.weekend}}">• 周末不支持使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用</view>
<view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用
</view>

<view class="timeText">购买限制</view>
<view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view>
<view class="timeText">预约消费</view>
<view class="Hchild" tt:if="{{!data.subscribeSing}}">• 无需预约,高峰时段可能等位</view>
<view class="Hchild" tt:if="{{data.subscribeSing}}">• {{data.subscribeSing}}</view>

<view class="timeText" tt:if="{{data.rec_person_num_max}}">适用人数</view>
<view class="Hchild" tt:if="{{data.rec_person_num_max}}">• 该团购劵最多{{data.rec_person_num_max}}人使用</view>
<view class="timeText">温馨提示</view>
<view class="Hchild">• 团购券不支持配送或外卖</view>
<view class="Hchild" tt:if="{{data.pack}}">• 该团购商品{{data.pack=='false'?'不支持':'支持'}}打包</view>
<view class="Hchild" tt:if="{{data.besides}}">• {{data.besides=="false"?'不可以':'可以'}}外带餐食</view>
<view class="Hchild" tt:if="{{data.superimposed_discounts}}">• {{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>

<view class="Hchild" tt:if="{{data.superimposed_discounts}}">•
{{data.superimposed_discounts=="false"?'不可以':'可以'}}享受店内其他优惠</view>
<view class="Hchild" tt:if="{{data.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view>
<view class="notesH" tt:if="{{data.curLsit}}">使用规则</view>
<view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}">
<view class="timeText" tt:if="{{item.title!=''}}">{{item.title}}</view>
<text class="Hchild">{{item.content}}</text>
</view>
</view>
<view tt:if="{{couponList.length!=0}}"
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;">其他活动
style="color: #333;letter-spacing: 0;font-size: 30rpx;height: 70rpx;line-height: 70rpx;margin-left: 35rpx;font-weight: bold;">
其他活动
</view>
<view class='couponsL clearfix'>
<c-coupons tt:if="{{couponList.length!=0}}" tt:for="{{couponList}}" from="fromMerchant" paramAtoB="{{loading}}"


+ 15
- 13
pages/refund/refund.js 查看文件

@@ -2,33 +2,34 @@ const Http = require("../../utils/HttpBasics");
var config = require("../../config/config.js");
const util = require("../../utils/util.js");
var app = getApp();
const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px'
const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px'
Page({
data: {
navigationBarHeight,
id:"",
obj:null
id: "",
obj: null
},
getRefunData(){
getRefunData() {
Http.get({
url:config.api.getRefund,
data:{
orderId:this.data.id
url: config.api.getRefund,
data: {
orderId: this.data.id,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res=>{
}).then(res => {
let temp = res.data
temp.createTime = util.formatTime(temp.createTime, "yyyy-MM-dd hh:mm:ss");
this.setData({
obj:temp
obj: temp
})
}).catch(err=>{
}).catch(err => {
tt.showToast({
title: err.message ? err.message : err.data, // 内容
icon: "none"
});
})
},
copyId(){
copyId() {
let id = this.data.obj.id
tt.setClipboardData({
data: id,
@@ -43,8 +44,9 @@ Page({
onLoad: function (options) {
console.log(options.id);
this.setData({
id:options.id
id: options.id,
mallTenantId: options.mallTenantId,
})
this.getRefunData()
}
})
})

+ 88
- 1
project.config.json 查看文件

@@ -1 +1,88 @@
{"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": 1678508631604,
"name": "pages/main/index",
"pathName": "pages/main/index",
"query": "type=uc&tenantId=1033",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1678428610317,
"name": "index/index",
"pathName": "pages/main/index",
"query": "type=scanIn&tenantId=1034",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1676971480642,
"name": "pages/liveLsit/liveLsit",
"pathName": "pages/liveLsit/liveLsit",
"query": "tenantId=1032",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1678330099779,
"name": " index/index(scanIn)",
"pathName": "index/index",
"query": "type=in&tenantId=1032",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1678687102364,
"name": "奥尔良鸡腿(昌东)",
"pathName": "pages/main/index",
"query": "type=cd&couponChannelId=790733288312070144&tenantId=1032",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1679365133968,
"name": "爽口酸萝卜一份(昌西)",
"pathName": "pages/main/index",
"query": "type=cd&couponChannelId=792625127019700224&tenantId=1033",
"scene": "990001",
"launchFrom": "scan",
"location": "qr_code"
},
{
"id": 1679474738627,
"name": "detail",
"pathName": "pages/coupon/detail/index",
"query": "type=cd&couponChannelId=792625127019700224&tenantId=1033",
"scene": "027005",
"launchFrom": "live",
"location": "live_cart_card"
}
]
}
}
}

+ 34
- 10
utils/HttpBasics.js 查看文件

@@ -23,19 +23,36 @@ class HttpBasics {
token: "",
// token:"3ab2afa2-f704-4086-b6e5-ad0715c7e2a1:1027:tt-cuser"
};

/**
* 设置token
* @description 设置token
* @param {*} token
*/
setToken(token) {
this.headers.token = token;
}

// /**
// * @description 设置mallTenantId
// * @param {*} mallTenantId
// */
// setMallTenantId(mallTenantId) {
// this.headers.mallTenantId = mallTenantId;
// }

/**
* 获取数据
* @param {url,data,headers} param0
*/
get({ url, data, headers }) {
headers = { ...this.headers, ...headers };
get({
url,
data,
headers
}) {
headers = {
...this.headers,
...headers
};
url = `${this.address}${url}`;
return new Promise((resolve, reject) => {
tt.request({
@@ -45,16 +62,16 @@ class HttpBasics {
method: "get",
success: res => {
this.responseMap(res, resolve, reject);
},
},
fail: err => {
console.log(err)
if (err.errMsg == 'request:fail timeout') {
err.errMsg = '请求超时,请检查您的网络设置!'
} else if (err.errMsg == 'request:fail'){
} else if (err.errMsg == 'request:fail') {
err.errMsg = '未检查到您的网络,请检查您的网络设置!'
} else if (err.errMsg == 'request:fail request connect error') {
err.errMsg = '连接失败'
}
}
reject(err);
}
});
@@ -64,8 +81,15 @@ class HttpBasics {
* 提交数据
* @param {url,data,headers} param0
*/
post({ url, data, headers }) {
headers = { ...this.headers, ...headers };
post({
url,
data,
headers
}) {
headers = {
...this.headers,
...headers
};
url = `${this.address}${url}`;
return new Promise((resolve, reject) => {
tt.request({
@@ -83,7 +107,7 @@ class HttpBasics {
err.errMsg = '未检查到您的网络,请检查您的网络设置!'
} else if (err.errMsg == 'request:fail request connect error') {
err.errMsg = '连接失败'
}
}
reject(err);
},
complete: res => {}
@@ -117,4 +141,4 @@ class HttpBasics {
/** 日志 */
log(url, body, headers) {}
}
module.exports = new HttpBasics();
module.exports = new HttpBasics();

正在加载...
取消
保存