| @@ -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", | |||
| } | |||
| @@ -1,44 +1,46 @@ | |||
| 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 +48,7 @@ App({ | |||
| }); | |||
| }, | |||
| statusBarHeight: 0, | |||
| getTemplateId(that) { | |||
| // console.log("隐藏") | |||
| @@ -72,42 +74,85 @@ App({ | |||
| } | |||
| }) | |||
| }, | |||
| logn(){ | |||
| /** | |||
| * desc: 主题色配置 | |||
| * borderRadius:按钮圆角大小,默认 8rpx | |||
| * backgroundColor:按钮背景色 + 退款原因选中背景色,默认 #FE2C55 | |||
| * fontColor:按钮字体颜色,默认 #ffffff | |||
| */ | |||
| getThemeConfig() { | |||
| return { | |||
| borderRadius: '8rpx', // string | |||
| backgroundColor: '#FE2C55', // string | |||
| fontColor: '#ffffff', // string | |||
| } | |||
| }, | |||
| /** | |||
| * desc: 获取手机号 | |||
| * params:加密数据 | |||
| * success:成功回调 | |||
| * fail: 失败回调 | |||
| */ | |||
| getPhoneNumber({ | |||
| params, | |||
| success, | |||
| fail | |||
| }) { | |||
| const { | |||
| iv, | |||
| encryptedData | |||
| } = params; | |||
| // ... | |||
| // 开发者服务端解密 encryptedData,得到手机号 | |||
| // ... | |||
| const result = { | |||
| phoneNumber: '13580006666', | |||
| } | |||
| // 回调前端模板 | |||
| success(result) | |||
| }, | |||
| 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; | |||
| that.globalData.mouldType = 1; | |||
| 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 +171,6 @@ App({ | |||
| }) | |||
| }), | |||
| }); | |||
| } | |||
| }) | |||
| }) | |||
| @@ -36,13 +36,23 @@ | |||
| "pages/refund/refund", | |||
| "pages/serviceWebView/serviceWebView", | |||
| "pages/liveLsit/liveLsit", | |||
| "pages/coupon/confirmation/confirmation", | |||
| "pages/coupon/instructions/instructions" | |||
| "pages/coupon/confirmation/confirmation", | |||
| "pages/coupon/instructions/instructions", | |||
| "pages/freeBannerDetail/freeBannerDetail", | |||
| "ext://microapp-trade-plugin/order-confirm", | |||
| "ext://microapp-trade-plugin/refund-apply", | |||
| "ext://microapp-trade-plugin/refund-detail" | |||
| ], | |||
| "subpackages": [{ | |||
| "root": "pages2", | |||
| "pages": [ | |||
| "appointment/appointment", | |||
| "shopSelect/shopSelect" | |||
| ] | |||
| }], | |||
| "window": { | |||
| "backgroundTextStyle": "light", | |||
| "navigationBarBackgroundColor": "#fff", | |||
| "navigationBarTextStyle": "black" | |||
| } | |||
| } | |||
| @@ -19,44 +19,47 @@ 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) { | |||
| console.log('freeBannerDetail'); | |||
| // 自由图文 | |||
| tt.navigateTo({ | |||
| url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | |||
| url: `/pages/freeBannerDetail/freeBannerDetail?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 +71,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 +86,10 @@ Component({ | |||
| }, | |||
| attached: function () { | |||
| // 在组件实例进入页面节点树时执行 | |||
| if (app.globalData.mouldType){ | |||
| if (app.globalData.mouldType) { | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType | |||
| }) | |||
| } | |||
| }, | |||
| }); | |||
| }); | |||
| @@ -1,19 +1,23 @@ | |||
| <view tt:if="{{list.length>0&&mouldType==0}}" class="index-slide-view"> | |||
| <swiper class="imageContainer" bindchange="handleChange" previous-margin="39rpx" next-margin="40rpx" circular autoplay> | |||
| <block tt:for="{{list}}" tt:key="{{index}}"> | |||
| <swiper-item class="item"> | |||
| <image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg {{currentIndex == index ? 'active': ''}}" src="{{item.coverImg}}"></image> | |||
| </swiper-item> | |||
| </block> | |||
| </swiper> | |||
| </view> | |||
| <view tt:if="{{list.length>0&&mouldType==1}}" class="index-slide-view1"> | |||
| <swiper class="imageContainer1" bindchange="handleChange" indicator-color indicator-active-color="#fff" indicator-dots circular autoplay> | |||
| <block tt:for="{{list}}" tt:key="{{index}}"> | |||
| <swiper-item class="item1"> | |||
| <image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg1 {{currentIndex == index ? 'active1_a': 'active1'}}" src="{{item.coverImg}}"></image> | |||
| </swiper-item> | |||
| </block> | |||
| </swiper> | |||
| </view> | |||
| <swiper class="imageContainer" bindchange="handleChange" previous-margin="39rpx" next-margin="40rpx" circular | |||
| autoplay> | |||
| <block tt:for="{{list}}" tt:key="{{index}}"> | |||
| <swiper-item class="item"> | |||
| <image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' | |||
| class="itemImg {{currentIndex == index ? 'active': ''}}" src="{{item.coverImg}}"></image> | |||
| </swiper-item> | |||
| </block> | |||
| </swiper> | |||
| </view> | |||
| <view tt:if="{{list.length>0&&mouldType==1}}" class="index-slide-view1"> | |||
| <swiper class="imageContainer1" bindchange="handleChange" indicator-color indicator-active-color="#fff" indicator-dots | |||
| circular autoplay> | |||
| <block tt:for="{{list}}" tt:key="{{index}}"> | |||
| <swiper-item class="item1"> | |||
| <image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' | |||
| class="itemImg1 {{currentIndex == index ? 'active1_a': 'active1'}}" src="{{item.coverImg}}"></image> | |||
| </swiper-item> | |||
| </block> | |||
| </swiper> | |||
| </view> | |||
| @@ -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({ | |||
| @@ -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> | |||
| @@ -4,9 +4,9 @@ Component({ | |||
| * 组件的属性列表 | |||
| */ | |||
| properties: { | |||
| businessList:{ | |||
| type:Array, | |||
| value:[] | |||
| businessList: { | |||
| type: Array, | |||
| value: [] | |||
| }, | |||
| businessData: { | |||
| type: Array, | |||
| @@ -18,39 +18,51 @@ 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 | |||
| const data = { | |||
| couponChannelId, | |||
| couponId, | |||
| mallTenantId | |||
| } | |||
| // const path = `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&mallTenantId=${mallTenantId}` | |||
| const path = `/pages/coupon/detail/index?params=${JSON.stringify(data)}` | |||
| console.log(path, 'path'); | |||
| tt.navigateTo({ | |||
| url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
| url: path, | |||
| }) | |||
| }, | |||
| 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) => { | |||
| }, | |||
| }); | |||
| } | |||
| } | |||
| }) | |||
| }) | |||
| @@ -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> | |||
| @@ -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 | |||
| } | |||
| @@ -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() { | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "component": true | |||
| } | |||
| @@ -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; | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| <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[0]]}}" 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="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> | |||
| @@ -0,0 +1,186 @@ | |||
| .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; | |||
| 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; | |||
| } | |||
| @@ -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({ | |||
| } | |||
| } | |||
| } | |||
| }); | |||
| }); | |||
| @@ -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> | |||
| @@ -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") { | |||
| @@ -1,6 +1,5 @@ | |||
| const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync().extConfig : {} | |||
| let weappId = extConfig.weappId; | |||
| console.log(extConfig,"configUrls"); | |||
| let configUrls = extConfig.attr.configUrl; | |||
| var config = { | |||
| @@ -9,40 +8,40 @@ var config = { | |||
| /** | |||
| * 判断小程序是否能有插件 | |||
| */ | |||
| getConfig:"/sysConfig/getByKey", | |||
| getConfig: "/sysConfig/getByKey", | |||
| /* | |||
| *欢乐城首页专题 | |||
| */ | |||
| showList:"/topic/showList", | |||
| *欢乐城首页专题 | |||
| */ | |||
| showList: "/topic/showList", | |||
| /* | |||
| *记录微信订阅 | |||
| */ | |||
| activityDey:"/wxActivity/listStatus",//活动日历日期 | |||
| activityCalendar:'/wxActivity/list',//活动日历列表 | |||
| signDey:"/userSign/listStatus",//签到日期列表 | |||
| continuousDye:"/userSign/signInStatus",//连续签到天数 | |||
| userSign:"/userSign/signIn",//签到 | |||
| signRule:"/credit/credit_rules",//签到规则 | |||
| activityDey: "/wxActivity/listStatus", //活动日历日期 | |||
| activityCalendar: '/wxActivity/list', //活动日历列表 | |||
| signDey: "/userSign/listStatus", //签到日期列表 | |||
| continuousDye: "/userSign/signInStatus", //连续签到天数 | |||
| userSign: "/userSign/signIn", //签到 | |||
| signRule: "/credit/credit_rules", //签到规则 | |||
| wxMsg: '/user/updateMsg', | |||
| // 获取服务资质 | |||
| getAppIcp:"/mall/getAppIcp", | |||
| getAppIcp: "/mall/getAppIcp", | |||
| /** | |||
| * 获取首页按钮 | |||
| */ | |||
| wxCustomizeModule:"/wxCustomizeModule/list", | |||
| wxCustomizeModule: "/wxCustomizeModule/list", | |||
| /** | |||
| * 抖音消息推送获取模板id | |||
| */ | |||
| templateId: "/wxMsg/ttTemplateList", | |||
| //问卷列表 | |||
| questionnaire :"/wxQuestionOneself/list", | |||
| questionnaire: "/wxQuestionOneself/list", | |||
| //问卷详情 | |||
| questionnaireDetail:"/wxQuestionOneself/detailsById", | |||
| questionnaireDetail: "/wxQuestionOneself/detailsById", | |||
| //提交问卷 | |||
| submitQuestin:"/wxQuestionOneself/userAdd", | |||
| submitQuestin: "/wxQuestionOneself/userAdd", | |||
| //投诉建议add | |||
| suggest:"/wxOpinion/add", | |||
| suggest: "/wxOpinion/add", | |||
| /** | |||
| * 接口用途:login | |||
| */ | |||
| @@ -71,31 +70,34 @@ var config = { | |||
| listByMerchant: "/wxCouponChannel/listByMerchant", | |||
| /** | |||
| * 获取券价格与库存 | |||
| */ | |||
| couponPriceAndStock:"/wxCoupon/couponPriceAndStock", | |||
| * 获取券价格与库存 | |||
| */ | |||
| couponPriceAndStock: "/wxCoupon/couponPriceAndStock", | |||
| /** | |||
| * 获取券适用门店List | |||
| */ | |||
| couponMerchant:"/wxCoupon/couponMerchant", | |||
| couponMerchant: "/wxCoupon/couponMerchant", | |||
| /** | |||
| * 获取适用门店所在的城市list | |||
| */ | |||
| couponMerchantCity: "/wxCoupon/couponMerchantCity", | |||
| /** | |||
| * 获取券详情 | |||
| */ | |||
| newCouponDetail:'/wxCoupon/couponDetail', | |||
| /** | |||
| newCouponDetail: '/wxCoupon/couponDetail', | |||
| /** | |||
| * 优惠券详情 | |||
| */ | |||
| couponDetail: "/wxCoupon/detail", | |||
| /** | |||
| * 购物车订单详情 | |||
| */ | |||
| goodsDetail:"/order/goodsDetail", | |||
| goodsDetail: "/order/goodsDetail", | |||
| /** | |||
| * 获取直播商品列表的价格和库存 | |||
| */ | |||
| batchCouponPriceAndStock:"/wxCoupon/batchCouponPriceAndStock", | |||
| batchCouponPriceAndStock: "/wxCoupon/batchCouponPriceAndStock", | |||
| /** | |||
| * 优惠券图文混排详情 | |||
| */ | |||
| @@ -130,9 +132,9 @@ var config = { | |||
| */ | |||
| orderSave: "/order/save", | |||
| /** | |||
| * 多少量下单 | |||
| */ | |||
| goodsShopCartSave:"/order/goodsShopCartSave", | |||
| * 多少量下单 | |||
| */ | |||
| goodsShopCartSave: "/order/goodsShopCartSave", | |||
| /** | |||
| * 支付订单 | |||
| */ | |||
| @@ -140,7 +142,7 @@ var config = { | |||
| /** | |||
| * 2.0订单支付 | |||
| */ | |||
| payOrderCreate_2: "/pay/ttcreatev2", | |||
| payOrderCreate_2: "/pay/ttcreatev2", | |||
| /** | |||
| * 订单状态更新 | |||
| @@ -156,6 +158,30 @@ var config = { | |||
| * 订单详情 | |||
| */ | |||
| orderDetail: "/order/detail_v1", | |||
| /** | |||
| * 订单退款状态 | |||
| */ | |||
| getRefundStatus: "/order/getRefundStatus", | |||
| /** | |||
| * 查询预约状态 | |||
| */ | |||
| getUserReservation: "/wxCouponOrderReservation/getUserReservation", | |||
| /** | |||
| * 保存/更改预约信息 | |||
| */ | |||
| saveOrderReservation: "/wxCouponOrderReservation/saveOrUpdate", | |||
| /** | |||
| * 查询预约详情 | |||
| */ | |||
| getOrderReservationDetail: "/wxCouponOrderReservation/detail", | |||
| /** | |||
| * 取消预约 | |||
| */ | |||
| cancelReservation: "/wxCouponOrderReservation/cancelReservation", | |||
| /** | |||
| * 获取im客服id | |||
| */ | |||
| getIm: "/mallIm/getIm", | |||
| // 券包详情 | |||
| // orderDetailAll: "/order/detail_v1", | |||
| /** | |||
| @@ -409,13 +435,13 @@ var config = { | |||
| // 获取直播房间回放数据和商品信息 | |||
| getRoomList: "/live/roomList", | |||
| //商城地图 | |||
| getStoreMap:"/wxMallBuilding/getbuildingfloorlist", | |||
| getStoreMap: "/wxMallBuilding/getbuildingfloorlist", | |||
| //判断有没有蜂鸟地图 | |||
| ifFengMap:'/fengniaomap/getConfig', | |||
| ifFengMap: '/fengniaomap/getConfig', | |||
| //分享小程序二维码 | |||
| getQrcodeFx:"/user/userinfoQrCode", | |||
| getQrcodeFx: "/user/userinfoQrCode", | |||
| //添加收货地址 | |||
| collectSite:"/userBasicInfoAddress/saveOrUpdate", | |||
| collectSite: "/userBasicInfoAddress/saveOrUpdate", | |||
| //收货地址列表 | |||
| siteList: "/userBasicInfoAddress/list", | |||
| //查询收货地址 | |||
| @@ -423,49 +449,49 @@ var config = { | |||
| //删除收获地址 | |||
| siteDel: "/userBasicInfoAddress/del", | |||
| //确认收货 | |||
| verify:"/couponOrder/verify", | |||
| verify: "/couponOrder/verify", | |||
| //全包下订单 | |||
| couponPackageSave :"/order/couponPackageSave", | |||
| couponPackageSave: "/order/couponPackageSave", | |||
| //获取动态核销码 | |||
| dynamicId:"/couponOrder/dynamicId", | |||
| dynamicId: "/couponOrder/dynamicId", | |||
| /** | |||
| * 获取门店资质 | |||
| */ | |||
| certification:"/merchant/findCorp", | |||
| certification: "/merchant/findCorp", | |||
| /** | |||
| * 交易快照 | |||
| */ | |||
| getSnapshot:"/order/getSnapshot", | |||
| getSnapshot: "/order/getSnapshot", | |||
| /** | |||
| * 退款 | |||
| */ | |||
| refund:"/order/refund", | |||
| refund: "/order/refund", | |||
| /** | |||
| * 查询退款详情 | |||
| */ | |||
| getRefund:"/order/getRefund", | |||
| getRefund: "/order/getRefund", | |||
| /* | |||
| *查询Spuid | |||
| */ | |||
| getSpuid:'/wxCouponChannel/getChannelPoi', | |||
| *查询Spuid | |||
| */ | |||
| getSpuid: '/wxCouponChannel/getChannelPoi', | |||
| /** | |||
| * 获取支付订单 | |||
| */ | |||
| getchanId:"/couponOrder/getChannelPoi", | |||
| getchanId: "/couponOrder/getChannelPoi", | |||
| /** | |||
| * 获取客服链接 | |||
| */ | |||
| getServiceUrl:"/ttopen/merchantPoi/query_customer_service_url", | |||
| */ | |||
| getServiceUrl: "/ttopen/merchantPoi/query_customer_service_url", | |||
| /** | |||
| * 取消订单 | |||
| */ | |||
| orderCancel:"/order/cancel", | |||
| orderCancel: "/order/cancel", | |||
| /** | |||
| * 判断是否支付 | |||
| */ | |||
| continueToPay:"/order/continueToPay", | |||
| continueToPay: "/order/continueToPay", | |||
| }, | |||
| weapp: { | |||
| AppId: weappId | |||
| @@ -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 | |||
| } | |||
| } | |||
| @@ -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": "首页" | |||
| } | |||
| } | |||
| @@ -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 /> | |||
| @@ -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; | |||
| } | |||
| } | |||
| @@ -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> | |||
| @@ -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({ | |||
| @@ -3,6 +3,8 @@ const navigationBarHeight = (getApp().statusBarHeight + 50) + "px"; | |||
| const Http = require("../utils/HttpBasics"); | |||
| const config = require("../config/config"); | |||
| const imgurl = require("../utils/imgurl"); | |||
| Page({ | |||
| data: { | |||
| navigationBarHeight, | |||
| @@ -10,7 +12,8 @@ Page({ | |||
| text: "授权手机号", | |||
| avatarUrl: "", | |||
| nickName: "", | |||
| mouldType:1, | |||
| mouldType: 1, | |||
| version: "" | |||
| }, | |||
| showPhoemBtn() { | |||
| @@ -23,7 +26,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 +51,8 @@ Page({ | |||
| }, | |||
| setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功 | |||
| setPhone(paramData) { | |||
| //子组件调用这个方法说明手机号已经授权成功 | |||
| this.setData({ | |||
| showPhoem: paramData.detail, | |||
| }) | |||
| @@ -63,6 +67,13 @@ Page({ | |||
| }, | |||
| }); | |||
| }, | |||
| goSetUserInfo() { | |||
| tt.navigateTo({ | |||
| url: '/pages/getuserinfo/getuserinfo?mineFlag=mine', | |||
| }); | |||
| }, | |||
| getmemberId: function (token) { | |||
| Http.get({ | |||
| url: config.api.getScore, | |||
| @@ -91,19 +102,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 +122,16 @@ Page({ | |||
| // }); | |||
| }, | |||
| onShow: function (options) { | |||
| const version = app.globalData.version | |||
| if (version) { | |||
| this.setData({ | |||
| version | |||
| }) | |||
| } | |||
| this.setData({ | |||
| mouldType:app.globalData.mouldType | |||
| mouldType: app.globalData.mouldType | |||
| }) | |||
| this.getmemberId() | |||
| Http.get({ | |||
| @@ -124,27 +142,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', | |||
| @@ -1,10 +1,10 @@ | |||
| { | |||
| "navigationBarTitleText": "我的", | |||
| "navigationBarBackgroundColor": "#fff", | |||
| "navigationBarTextStyle": "black", | |||
| "usingComponents": { | |||
| "navbar": "../components/navbar/navbar", | |||
| "phoem":"../components/getPhoen/getPhoen", | |||
| "tabbar":"../components/tabbar/tabbar" | |||
| } | |||
| "navigationBarTitleText": "我的", | |||
| "navigationBarBackgroundColor": "#fff", | |||
| "navigationBarTextStyle": "black", | |||
| "usingComponents": { | |||
| "navbar": "../components/navbar/navbar", | |||
| "phoem": "../components/getPhoen/getPhoen", | |||
| "tabbar": "../components/tabbar/tabbar" | |||
| } | |||
| } | |||
| @@ -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,39 @@ | |||
| </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> | |||
| <view class="version">Version 2.9.3</view> | |||
| <phoem showBox="{{showPhoem}}" bind:hiePhoen="setPhone" bind:heiBox="setBox"></phoem> | |||
| </view> | |||
| <tabbar/> | |||
| </view> | |||
| <tabbar /> | |||
| @@ -1,5 +1,9 @@ | |||
| /* d:\fumaolianke\ttFmC\tt富茂C\pages\user\user.ttss */ | |||
| .BoxBg{ | |||
| page { | |||
| padding-bottom: 0; | |||
| } | |||
| .BoxBg { | |||
| /* background-image: url("https://formall.oss-accelerate.aliyuncs.com/douyin_ifomall/imgData/userBg.png"); */ | |||
| /* background-size: 100% auto; */ | |||
| /* background-repeat: no-repeat; */ | |||
| @@ -9,7 +13,8 @@ | |||
| background-color: #e6e6e6; | |||
| overflow: hidden; | |||
| } | |||
| .bgImgTop{ | |||
| .bgImgTop { | |||
| width: 100%; | |||
| height: 380rpx; | |||
| transform: rotate(16deg); | |||
| @@ -18,32 +23,38 @@ | |||
| left: 0; | |||
| z-index: 1; | |||
| } | |||
| .userBg{ | |||
| .userBg { | |||
| width: 100%; | |||
| height: 200rpx; | |||
| /* background:linear-gradient(180deg,rgba(253,131,45,1) 0%,rgba(254,74,22,1) 100%); */ | |||
| position: relative; | |||
| } | |||
| .userBg1{ | |||
| .userBg1 { | |||
| width: 100%; | |||
| height: 200rpx; | |||
| /* background-image: url("/assets/imgData/userBg.png"); */ | |||
| position: relative; | |||
| z-index: 1000; | |||
| } | |||
| button::after { | |||
| border: none; | |||
| } | |||
| } | |||
| button { | |||
| background-color: transparent; | |||
| padding-left: 0; | |||
| padding-right: 0; | |||
| line-height:inherit; | |||
| line-height: inherit; | |||
| } | |||
| button { | |||
| border-radius:0; | |||
| border-radius: 0; | |||
| } | |||
| .userLogo{ | |||
| .userLogo { | |||
| position: absolute; | |||
| top: 40rpx; | |||
| left: 80rpx; | |||
| @@ -53,24 +64,29 @@ button { | |||
| border-radius: 50%; | |||
| border: 2rpx solid #A2B9BE; | |||
| } | |||
| .userLogo open-data{ | |||
| .userLogo open-data { | |||
| display: block; | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .userLogo img{ | |||
| .userLogo img { | |||
| border-radius: 50% !important; | |||
| } | |||
| .open{ | |||
| .open { | |||
| width: 100% !important; | |||
| height:100% !important; | |||
| height: 100% !important; | |||
| border-radius: 50% !important; | |||
| overflow: hidden; | |||
| } | |||
| .open img{ | |||
| .open img { | |||
| border-radius: 50% !important; | |||
| } | |||
| .userData{ | |||
| .userData { | |||
| position: absolute; | |||
| top: 40rpx; | |||
| left: 180rpx; | |||
| @@ -79,23 +95,24 @@ button { | |||
| /* color: #ffffff; */ | |||
| } | |||
| .noInfo{ | |||
| .noInfo { | |||
| width: 220rpx; | |||
| margin-left: 20rpx; | |||
| font-size: 32rpx; | |||
| text-overflow: -o-ellipsis-lastline; | |||
| overflow:hidden; | |||
| text-overflow:ellipsis; | |||
| display:-webkit-box; | |||
| -webkit-box-orient:vertical; | |||
| -webkit-line-clamp:1; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| display: -webkit-box; | |||
| -webkit-box-orient: vertical; | |||
| -webkit-line-clamp: 1; | |||
| color: #02201c; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 36rpx; | |||
| font-weight: 400; | |||
| text-transform: uppercase; | |||
| } | |||
| .info{ | |||
| .info { | |||
| border: 1rpx #ffffff solid; | |||
| border-radius: 50rpx; | |||
| padding: 0 10rpx; | |||
| @@ -104,7 +121,8 @@ button { | |||
| text-align: center; | |||
| /* width: 130rpx; */ | |||
| } | |||
| .infoX{ | |||
| .infoX { | |||
| /* border: 1rpx #ffffff solid; */ | |||
| border-radius: 50rpx; | |||
| padding: 0 10rpx; | |||
| @@ -117,19 +135,22 @@ button { | |||
| text-transform: uppercase; | |||
| /* text-align: center; */ | |||
| } | |||
| .userName{ | |||
| .userName { | |||
| position: absolute; | |||
| top: 60rpx; | |||
| left: 180rpx; | |||
| font-size: 26rpx; | |||
| color: #ffffff; | |||
| } | |||
| .tempBpx{ | |||
| .tempBpx { | |||
| position: relative; | |||
| width: 680rpx; | |||
| height: 160rpx; | |||
| } | |||
| .functionBox{ | |||
| .functionBox { | |||
| position: absolute; | |||
| width: 680rpx; | |||
| height: 160rpx; | |||
| @@ -139,30 +160,35 @@ button { | |||
| /* background-color: #ffffff; */ | |||
| border-radius: 10rpx; | |||
| display: flex; | |||
| justify-content:space-around; | |||
| justify-content: space-around; | |||
| /* overflow: hidden; */ | |||
| z-index: 100; | |||
| } | |||
| .itemBox{ | |||
| width:30% ; | |||
| .itemBox { | |||
| width: 30%; | |||
| /* text-align: center; */ | |||
| } | |||
| .itemLogoBox{ | |||
| .itemLogoBox { | |||
| width: 60rpx; | |||
| height: 60rpx; | |||
| /* background-color: #cacaca; */ | |||
| margin: 20rpx auto 0 auto; | |||
| } | |||
| .itemLogo{ | |||
| .itemLogo { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .itemNAme{ | |||
| .itemNAme { | |||
| text-align: center; | |||
| font-size: 26rpx; | |||
| margin-top: 10rpx; | |||
| } | |||
| .moreBox{ | |||
| .moreBox { | |||
| width: 680rpx; | |||
| margin: 20rpx auto 0 auto; | |||
| background-color: #ffffff; | |||
| @@ -172,26 +198,31 @@ button { | |||
| position: absolute; | |||
| z-index: 1000; | |||
| } | |||
| .fuwu{ | |||
| .fuwu { | |||
| /* font-size: 28rpx; */ | |||
| margin: 20rpx 0 20rpx 40rpx ; | |||
| margin: 20rpx 0 20rpx 40rpx; | |||
| color: #5d3a19; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 32rpx; | |||
| font-weight: 400; | |||
| } | |||
| .fuwuItemBox{ | |||
| .fuwuItemBox { | |||
| /* display: flex; */ | |||
| overflow: hidden; | |||
| } | |||
| .f{ | |||
| .f { | |||
| float: left; | |||
| } | |||
| .r{ | |||
| .r { | |||
| float: right; | |||
| } | |||
| .fuwuItem{ | |||
| .fuwuItem { | |||
| /* width: 25%; */ | |||
| /* background-color: aquamarine; */ | |||
| border-bottom: 1rpx #f6f6f6 solid; | |||
| @@ -201,14 +232,23 @@ button { | |||
| margin: 0 auto; | |||
| } | |||
| .fuwuLogoBox{ | |||
| .fuwuLogoBox { | |||
| width: 50rpx; | |||
| height: 50rpx; | |||
| /* background-color: #fb3e5c; */ | |||
| } | |||
| .fuwuName{ | |||
| .fuwuName { | |||
| text-align: center; | |||
| font-size: 24rpx; | |||
| margin-top: 10rpx; | |||
| margin-left: 10rpx; | |||
| } | |||
| .version { | |||
| position: absolute; | |||
| bottom: 150rpx; | |||
| right: 5%; | |||
| color: #ffffffb9; | |||
| } | |||
| @@ -0,0 +1,11 @@ | |||
| { | |||
| "ttPlugins": { | |||
| "dependencies": { | |||
| "microapp-trade-plugin": { | |||
| "version": "1.1.2", | |||
| "isDynamic": true | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -15,21 +15,32 @@ Page({ | |||
| hour: "", | |||
| wmhome: imgurl.wmhome.url, | |||
| minute: "", | |||
| nodes: '' | |||
| nodes: '', | |||
| mallTenantId: "" | |||
| }, | |||
| onLoad(options) { | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType, | |||
| }) | |||
| const mallTenantId = tt.getStorageSync('mallTenantId'); | |||
| if (mallTenantId) { | |||
| this.setData({ | |||
| mallTenantId: mallTenantId | |||
| }) | |||
| } | |||
| 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 +63,4 @@ Page({ | |||
| url: '/index/index', | |||
| }) | |||
| }, | |||
| }); | |||
| }); | |||
| @@ -2,31 +2,32 @@ | |||
| <!-- <navbar back home text="详情" background="#fff"></navbar> --> | |||
| <!-- <view style="height:{{navigationBarHeight}} "></view> --> | |||
| <!-- banner活动详情页面 --> | |||
| <view class='coupons' > | |||
| <view class='coupons'> | |||
| <view class="coupons-body"> | |||
| <view class='banner'> | |||
| <image src='{{data.coverImg}}' mode="widthFix"></image> | |||
| </view> | |||
| </view> | |||
| <view class='act'> | |||
| <text class='txt001'>{{data.title}}</text> | |||
| <text class='txt002'>{{data.subTitle}}</text> | |||
| <view class="proct"> | |||
| <text>活动说明</text> | |||
| <text>{{data.detail}}</text> | |||
| </view> | |||
| <text class='txt001'>{{data.title}}</text> | |||
| <text class='txt002'>{{data.subTitle}}</text> | |||
| <view class="proct"> | |||
| <text>活动说明</text> | |||
| <text>{{data.detail}}</text> | |||
| </view> | |||
| <view class='notes' style='display:none;'> | |||
| <view> | |||
| <text>活动详情</text> | |||
| </view> | |||
| <view> | |||
| <text><text class='spot'></text>{{data.detail}}</text> | |||
| </view> | |||
| </view> | |||
| <view class='notes' style='display:none;'> | |||
| <view> | |||
| <text>活动详情</text> | |||
| </view> | |||
| <view> | |||
| <text><text class='spot'></text>{{data.detail}}</text> | |||
| </view> | |||
| </view> | |||
| <view class='contain clearfix'> | |||
| <!-- 优惠券 --> | |||
| <navigator tt:for="{{data.coupons}}" tt:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId={{item.id}}"> | |||
| <navigator tt:for="{{data.coupons}}" tt:key="{{index}}" | |||
| url="/pages/coupon/detail/index?couponChannelId={{item.id}}&mallTenantId={{mallTenantId}}"> | |||
| <!-- 首页优惠券列表页面 --> | |||
| <view class="coupons1" style="{{mouldType==1?'height: 540rpx;':''}}"> | |||
| <view class="coupons1-img" style="{{mouldType==1?'height: 344rpx;':''}}"> | |||
| @@ -40,7 +41,8 @@ | |||
| <view class="coupons-info-manjian" style="margin-top:10rpx;font-size:28rpx;" tt:if="{{item.type == 1}}"> | |||
| 满¥{{item.usePriceStr}}可用 | |||
| </view> | |||
| <view class="coupons-info-manjian" style="font-size:28rpx;" tt:if="{{item.type == 2||item.type == 3||item.type==4||item.type==5||item.type==6||item.type==7}}"> | |||
| <view class="coupons-info-manjian" style="font-size:28rpx;" | |||
| tt:if="{{item.type == 2||item.type == 3||item.type==4||item.type==5||item.type==6||item.type==7}}"> | |||
| 仅限本店使用 | |||
| </view> | |||
| </view> | |||
| @@ -54,19 +56,22 @@ | |||
| <view class="coupons-info-manjian" style="margin-top:10rpx;font-size:28rpx;" tt:if="{{item.type == 1}}"> | |||
| 满¥{{item.usePriceStr}}可用 | |||
| </view> | |||
| <view class="coupons-info-manjian" style="font-size:28rpx;" tt:if="{{item.type == 2||item.type == 3||item.type==4||item.type==5||item.type==6||item.type==7}}"> | |||
| <view class="coupons-info-manjian" style="font-size:28rpx;" | |||
| tt:if="{{item.type == 2||item.type == 3||item.type==4||item.type==5||item.type==6||item.type==7}}"> | |||
| 仅限本店使用 | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <!-- <view class="coupons1-info-name subtitle sy">剩余{{item.remainInventory}}</view> --> | |||
| <!-- <view class="coupons1-info-name subtitle sy">剩余{{item.remainInventory}}</view> --> | |||
| <view class="coupons1-btn"> | |||
| <!-- 优惠券价格 --> | |||
| <i-button class="{{mouldType!=1?'buy':'buyX'}}" hover-class='active' tt:if="{{item.salePriceStr==0}}" data-date='{{data}}'>免费领</i-button> | |||
| <i-button class="{{mouldType!=1?'buy':'buyX'}}" hover-class='active' tt:elif="{{item.salePriceStr!=0}}" data-date='{{data}}'>马上购</i-button> | |||
| <i-button class="{{mouldType!=1?'buy':'buyX'}}" hover-class='active' tt:if="{{item.salePriceStr==0}}" | |||
| data-date='{{data}}'>免费领</i-button> | |||
| <i-button class="{{mouldType!=1?'buy':'buyX'}}" hover-class='active' tt:elif="{{item.salePriceStr!=0}}" | |||
| data-date='{{data}}'>马上购</i-button> | |||
| </view> | |||
| <!-- <view class="coupons1-border"></view> --> | |||
| </view> | |||
| @@ -7,14 +7,46 @@ const imgurl = require("../../../utils/imgurl"); | |||
| Page({ | |||
| data: { | |||
| couponIds: "", | |||
| showPhoem: false, | |||
| couponChannelId: "", | |||
| showPage: false, | |||
| data: {}, | |||
| spuIdObj: {}, | |||
| priceAndStockObj: {} | |||
| priceAndStockObj: {}, | |||
| mallTenantId: '', | |||
| imId: "", | |||
| goodId: "", | |||
| IMorderId: "", | |||
| merchantId: "", | |||
| currentIndex: "", | |||
| mallList: [], | |||
| latitude: "", | |||
| longitude: "", | |||
| merOrderId: "", | |||
| shopItem: null | |||
| }, | |||
| 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'); | |||
| if (options.merOrderId) { | |||
| this.setData({ | |||
| merOrderId: options.merOrderId | |||
| }) | |||
| } | |||
| // this.getCouponMerchant(options.merOrderId) | |||
| tt.showLoading({ | |||
| title: "加载中..." | |||
| }); | |||
| @@ -37,8 +69,26 @@ Page({ | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| imCallback(e) { | |||
| console.log("跳转IM客服成功", e); | |||
| }, | |||
| setMerchant(e) { | |||
| console.log(e.detail.value, 'e'); | |||
| const index = e.detail.value | |||
| this.setData({ | |||
| currentIndex: index, | |||
| merchantId: this.data.mallList[index].id | |||
| }) | |||
| console.log(this.data.currentIndex, this.data.merchantId); | |||
| }, | |||
| onimError(e) { | |||
| console.log("拉起IM客服失败", e.detail); | |||
| }, | |||
| goInstructions() { | |||
| tt.navigateTo({ | |||
| url: '/pages/coupon/instructions/instructions?couponChannelId=' + this.data.couponChannelId, | |||
| @@ -50,14 +100,210 @@ Page({ | |||
| }, | |||
| }); | |||
| }, | |||
| getIm() { //获取im客服id | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getIm, | |||
| data: { | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getIm'); | |||
| const imId = res.data.imId ? res.data.imId : "" | |||
| that.setData({ | |||
| imId: imId | |||
| }) | |||
| }).catch(err => { | |||
| console.log(err, 'res'); | |||
| }) | |||
| }, | |||
| getCouponMerchant(couponChannelId) { //获取适用门店 | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.couponMerchant, | |||
| data: { | |||
| couponChannelId, | |||
| mallTenantId: that.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++ | |||
| }) | |||
| that.setData({ | |||
| mallList: mallList[0].merchantVoList | |||
| }) | |||
| console.log(that.data.mallList, 'mallList'); | |||
| that.getLocation() | |||
| }) | |||
| }, | |||
| /** | |||
| * 获得经纬度 | |||
| */ | |||
| getLocation() { | |||
| console.log('getLocation'); | |||
| let that = this; | |||
| tt.getLocation({ | |||
| type: "wgs84", | |||
| // isHighAccuracy: true, | |||
| success: function (res) { | |||
| console.log(res, 'getLocation') | |||
| that.setData({ | |||
| latitude: res.latitude, | |||
| longitude: res.longitude, | |||
| }) | |||
| const latitudeNow = res.latitude | |||
| const longitudeNow = res.longitude | |||
| const mallLocationArr = [] | |||
| const mallList = that.data.mallList | |||
| mallList.forEach((item, index) => { | |||
| const obj = { | |||
| latitude: item.latitude || false, | |||
| longitude: item.longitude || false, | |||
| id: item.id, | |||
| index: index | |||
| } | |||
| mallLocationArr.push(obj) | |||
| }) | |||
| console.log(mallLocationArr, 'mallLocationArr'); | |||
| const tempArr = mallList | |||
| const bloobArr = [] | |||
| mallLocationArr.forEach((item, index) => { | |||
| const distanceData = that.getDistances(latitudeNow, longitudeNow, item.latitude, item.longitude) | |||
| tempArr[index].distance_str = distanceData.distance_str | |||
| tempArr[index].distance_str = distanceData.distance_str | |||
| tempArr[index].distanceName = tempArr[index].merchantName + ' ' + distanceData.distance_str | |||
| tempArr[index].distance = distanceData.distance | |||
| bloobArr.push(tempArr[index]) | |||
| }) | |||
| const finalSortMallList = that.bloob(bloobArr) | |||
| console.log(finalSortMallList, 'finalSortMallList'); | |||
| that.setData({ | |||
| mallList: finalSortMallList | |||
| }) | |||
| }, | |||
| // 拒绝提供定位权限 | |||
| fail: error => { | |||
| console.log(error, 'error'); | |||
| const mallList = that.data.mallList | |||
| mallList.forEach(item => { | |||
| item.distanceName = item.merchantName | |||
| }) | |||
| that.setData({ | |||
| mallList | |||
| }) | |||
| }, | |||
| complete: finish => { | |||
| let isSuccess = 0 | |||
| const mallList = that.data.mallList | |||
| mallList.forEach(item => { | |||
| if (item.distance_str) { | |||
| isSuccess = 1 | |||
| } | |||
| }) | |||
| if (!isSuccess) { | |||
| tt.showToast({ | |||
| title: '定位失败!', | |||
| icon: "fail" | |||
| }); | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| /** | |||
| * @description:根据经纬度计算距离 | |||
| * @param {*} locationInfo (lat1, lng1, lat2, lng2) | |||
| * @return: distanceObj: { distance , distance_str } | |||
| */ | |||
| getDistances(lat1, lng1, lat2, lng2) { | |||
| if (lat2 || lng2) { | |||
| function rad(num) { | |||
| return num * Math.PI / 180.0; | |||
| } | |||
| var radLat1 = rad(lat1); | |||
| var radLat2 = rad(lat2); | |||
| var a = radLat1 - radLat2; | |||
| var b = rad(lng1) - rad(lng2); | |||
| var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + | |||
| Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); | |||
| s = s * 6378.137; | |||
| s = Math.round(s * 10000) / 10000; | |||
| var distance = s; | |||
| var distance_str = ""; | |||
| if (parseInt(distance) >= 1) { | |||
| distance_str = distance.toFixed(2) + "km"; | |||
| } else if (!arseInt(distance)) { | |||
| return false | |||
| } else { | |||
| distance_str = (distance * 1000).toFixed(2) + "m"; | |||
| } | |||
| let objData = { | |||
| distance: distance, | |||
| distance_str: distance_str | |||
| } | |||
| return objData | |||
| } else { | |||
| let objData = { | |||
| distance: Infinity, | |||
| distance_str: '' | |||
| } | |||
| return objData | |||
| } | |||
| }, | |||
| bloob(arr) { | |||
| const tempArr = arr | |||
| for (let i = 0; i < tempArr.length - 1; i++) { | |||
| for (let j = 0; j < tempArr.length - 1 - i; j++) { | |||
| if (tempArr[j].distance > tempArr[j + 1].distance) { | |||
| let temp = tempArr[j]; | |||
| tempArr[j] = tempArr[j + 1]; | |||
| tempArr[j + 1] = temp; | |||
| } | |||
| } | |||
| } | |||
| return tempArr | |||
| }, | |||
| getSupId(id) { | |||
| Http.get({ | |||
| url: config.api.getSpuid, | |||
| data: { id: id } | |||
| data: { | |||
| id: id | |||
| } | |||
| }).then(res => { | |||
| if (res.data) { | |||
| this.setData({ | |||
| spuIdObj: res.data | |||
| spuIdObj: res.data, | |||
| goodId: res.data.spuId | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| @@ -70,11 +316,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 +378,7 @@ Page({ | |||
| let that = this; | |||
| let data = {}; | |||
| that.getCouponPriceAndStock(couponChannelId);//获取券价格和库存 | |||
| that.getCouponPriceAndStock(couponChannelId); //获取券价格和库存 | |||
| if (that.data.couponIds) { | |||
| data.couponId = couponChannelId | |||
| } else { | |||
| @@ -211,7 +501,7 @@ Page({ | |||
| } | |||
| if (item.key == 'Description') { | |||
| if (item.key == 'Description' && item.isRequired) { | |||
| tempObj.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| @@ -232,6 +522,7 @@ Page({ | |||
| console.log(this.data.data, "data"); | |||
| } | |||
| }).catch(err => { | |||
| console.log(err, 'err'); | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| @@ -241,37 +532,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() | |||
| // 有价券 | |||
| tt.setStorageSync('appointment', true); | |||
| 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 | |||
| }` | |||
| 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 +592,8 @@ Page({ | |||
| Http.get({ | |||
| url: config.api.getUnPaidOrder, | |||
| data: { | |||
| couponId: couponId | |||
| couponId: couponId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| that.setData({ | |||
| @@ -324,13 +631,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}`, | |||
| }) | |||
| } | |||
| @@ -353,6 +660,13 @@ Page({ | |||
| */ | |||
| orderFunc(discount) { | |||
| if (this.data.showbutton) return; | |||
| if (!this.data.merchantId && this.data.data.type == 69) { | |||
| tt.showToast({ | |||
| title: '请选择可用商户!', | |||
| icon: 'fail' | |||
| }); | |||
| return | |||
| }; | |||
| let that = this; | |||
| tt.showLoading({ | |||
| @@ -364,7 +678,7 @@ Page({ | |||
| Http.get({ | |||
| url: config.api.checkUserStatus, | |||
| data: { | |||
| token: app.globalData.token | |||
| token: app.globalData.token, | |||
| } | |||
| }).then(res => { | |||
| Http.get({ | |||
| @@ -373,141 +687,158 @@ 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 | |||
| tempArr.push(tempObj) | |||
| } else { | |||
| url = config.api.orderSave | |||
| data.mallTenantId = that.data.mallTenantId || '' | |||
| if (that.data.data.type == 69) { | |||
| data.fixMerchantId = that.data.merchantId | |||
| } | |||
| /** | |||
| * 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 => { | |||
| } | |||
| /** | |||
| * 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) | |||
| }) | |||
| 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支付 | |||
| /** | |||
| } 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 +875,7 @@ Page({ | |||
| }) | |||
| } | |||
| } | |||
| } | |||
| else if (res.code === 1) { | |||
| } else if (res.code === 1) { | |||
| that.setData({ | |||
| showbutton: false | |||
| }) | |||
| @@ -605,66 +935,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 +1139,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 +1170,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", | |||
| @@ -847,5 +1182,27 @@ Page({ | |||
| }) | |||
| }, | |||
| goSelectShop() { | |||
| const data = this.data | |||
| const isOrder = true | |||
| const merOrderId = data.merOrderId | |||
| tt.navigateTo({ | |||
| url: `/pages2/shopSelect/shopSelect?isOrder=${isOrder}&merOrderId=${merOrderId}`, | |||
| }); | |||
| }, | |||
| onShow() { | |||
| this.getIm() | |||
| const shopItem = app.globalData.shopItem | |||
| if (shopItem) { | |||
| this.setData({ | |||
| shopItem, | |||
| merchantId: shopItem.id, | |||
| reservationMerchantName: "" | |||
| }) | |||
| console.log(this.data.shopItem, 'shopItem'); | |||
| app.globalData.shopItem = null | |||
| } | |||
| } | |||
| }) | |||
| @@ -3,7 +3,7 @@ | |||
| "navbar": "../../../components/navbar/navbar", | |||
| "store": "../../../components/store/index", | |||
| "c-coupons": "../../../components/coupons/index", | |||
| "phoen":"../../../components/getPhoen/getPhoen" | |||
| "phoem":"../../../components/getPhoen/getPhoen" | |||
| }, | |||
| "navigationBarTitleText": "确认订单", | |||
| "backgroundColor":"#f4f4f4", | |||
| @@ -1,23 +1,76 @@ | |||
| <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> | |||
| <button tt:if="{{imId && goodId}}" class="serviceBox" open-type="im" data-im-id="{{ imId }}" | |||
| data-im-type="goods" data-biz-line="1" data-goods-id="{{ goodId }}" bindim="imCallback" | |||
| binderror="onimError"> | |||
| <view class="fuwuLogoBox f"> | |||
| <image class="itemLogo" src="../../../assets/images/service1.png" /> | |||
| </view> | |||
| </button> | |||
| </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> | |||
| <!-- 仅当可预约时 --> | |||
| <view tt:if="{{ data.type == 69 }}"> | |||
| <!-- <view tt:if="{{ !merchantId }}" class="addressPickerFlex"> | |||
| <text>选择可用商户:</text> | |||
| <picker style="display: inline-block;" mode="selector" value="{{index}}" range="{{mallList}}" | |||
| range-key="{{mallList[0].distanceName ? 'distanceName' : 'merchantName'}}" disabled="{{false}}" | |||
| bindchange="setMerchant"> | |||
| <view class="pickerInside"> | |||
| 请选择 | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view tt:if="{{ merchantId }}" class="addressPicker"> | |||
| <picker style="display: inline;" mode="selector" value="{{index}}" range="{{mallList}}" | |||
| rrange-key="{{mallList[0].distanceName ? 'distanceName' : 'merchantName'}}" disabled="{{false}}" | |||
| bindchange="setMerchant"> | |||
| <text> 选择可用商户:<text class="pickerInside">{{ | |||
| mallList[currentIndex].merchantName }} <text tt:if="{{ mallList[currentIndex].distance_str }}" | |||
| class="distanceFoot">{{ | |||
| mallList[currentIndex].distance_str }}</text></text></text> | |||
| </picker> | |||
| </view> --> | |||
| <view tt:if="{{ !shopItem && !reservationMerchantName }}" class="addressPickerFlex" bindtap="goSelectShop"> | |||
| <text>选择可用商户:</text> | |||
| <view class="pickerInside"> | |||
| 请选择 | |||
| </view> | |||
| </view> | |||
| <view tt:if="{{ shopItem || reservationMerchantName }}" class="addressPicker" bindtap="goSelectShop"> | |||
| <text tt:if="{{ reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ reservationMerchantName | |||
| }}</text></text> | |||
| <text tt:else> 选择可用商户:<text class="pickerInside">{{ | |||
| shopItem.merchantName }} <text tt:if="{{ shopItem.distance_str }}" | |||
| class="distanceFoot">{{shopItem.distance_str }}</text></text></text> | |||
| </view> | |||
| </view> | |||
| @@ -1,11 +1,12 @@ | |||
| .commodityBox{ | |||
| .commodityBox { | |||
| background-color: #fff; | |||
| width: 96%; | |||
| border-radius: 12rpx; | |||
| overflow: hidden; | |||
| margin: 10rpx auto; | |||
| } | |||
| .commodityImgBox{ | |||
| .commodityImgBox { | |||
| width: 160rpx; | |||
| height: 160rpx; | |||
| overflow: hidden; | |||
| @@ -13,23 +14,45 @@ | |||
| margin: 20rpx; | |||
| border-radius: 8rpx; | |||
| } | |||
| .commodityImg{ | |||
| .commodityImg { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .contentBox{ | |||
| .serviceBox { | |||
| float: right; | |||
| margin-top: 48rpx; | |||
| margin-right: 14rpx; | |||
| height: 40rpx; | |||
| width: 40rpx; | |||
| background-color: #fff; | |||
| } | |||
| .fuwuLogoBox { | |||
| width: 40rpx; | |||
| height: 40rpx; | |||
| line-height: 0; | |||
| } | |||
| .itemLogo { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .contentBox { | |||
| width: 500rpx; | |||
| float: left; | |||
| height: 100rpx; | |||
| margin-top: 20rpx; | |||
| } | |||
| .topBox{ | |||
| .topBox { | |||
| overflow: hidden; | |||
| } | |||
| .title{ | |||
| .title { | |||
| height: 90rpx; | |||
| font-size: 32rpx; | |||
| width: 400rpx; | |||
| @@ -37,19 +60,23 @@ | |||
| text-overflow: ellipsis; | |||
| display: -webkit-box; | |||
| -webkit-box-orient: vertical; | |||
| -webkit-line-clamp: 2; /* 这里是超出几行省略 */ | |||
| -webkit-line-clamp: 2; | |||
| /* 这里是超出几行省略 */ | |||
| overflow: hidden; | |||
| } | |||
| .unit{ | |||
| .unit { | |||
| float: right; | |||
| font-size: 30rpx; | |||
| } | |||
| .subhead{ | |||
| .subhead { | |||
| margin-top: 4rpx; | |||
| color: #a6a6a6; | |||
| font-size: 24rpx; | |||
| } | |||
| .app-border-topX{ | |||
| .app-border-topX { | |||
| width: 100%; | |||
| height: 140rpx; | |||
| background-color: #fff; | |||
| @@ -58,39 +85,44 @@ | |||
| left: 0; | |||
| bottom: 0; | |||
| } | |||
| .actually{ | |||
| .actually { | |||
| margin-left: 10%; | |||
| font-size: 28rpx; | |||
| color: #a6a6a6; | |||
| line-height: 140rpx; | |||
| float: left; | |||
| } | |||
| .payZ{ | |||
| .payZ { | |||
| margin-left: 6rpx; | |||
| font-size: 24rpx; | |||
| color: #d5af67; | |||
| line-height: 144rpx; | |||
| float: left; | |||
| } | |||
| .price{ | |||
| .price { | |||
| font-size: 30rpx; | |||
| color: #d5af67; | |||
| line-height: 140rpx; | |||
| float: left; | |||
| float: left; | |||
| } | |||
| .buyX{ | |||
| float: right; | |||
| background: linear-gradient(270deg, #DDAB5A, #B8832D); | |||
| /* width: 80rpx; */ | |||
| color: #fff; | |||
| font-size: 30rpx; | |||
| .buyX { | |||
| float: right; | |||
| background: linear-gradient(270deg, #DDAB5A, #B8832D); | |||
| /* width: 80rpx; */ | |||
| color: #fff; | |||
| font-size: 30rpx; | |||
| border-radius: 60rpx; | |||
| margin: 30rpx 40rpx; | |||
| padding: 20rpx 40rpx; | |||
| border-radius: 60rpx; | |||
| margin: 30rpx 40rpx; | |||
| padding: 20rpx 40rpx; | |||
| } | |||
| .go{ | |||
| .go { | |||
| height: 120rpx; | |||
| width: 96%; | |||
| border-radius: 6px; | |||
| @@ -98,16 +130,45 @@ | |||
| margin: 5px auto; | |||
| background-color: #fff; | |||
| } | |||
| .goTitle{ | |||
| .goTitle { | |||
| float: left; | |||
| line-height: 120rpx; | |||
| font-size: 30rpx; | |||
| /* color: #a6a6a6; */ | |||
| margin-left: 20rpx; | |||
| } | |||
| .goImg{ | |||
| .goImg { | |||
| float: right; | |||
| width: 20rpx; | |||
| height: 40rpx; | |||
| margin: 40rpx 20rpx; | |||
| } | |||
| .addressPicker { | |||
| font-size: 30rpx; | |||
| background-color: #fff; | |||
| border-radius: 20rpx; | |||
| padding: 30rpx; | |||
| margin: 10rpx auto; | |||
| } | |||
| .addressPickerFlex { | |||
| display: flex; | |||
| justify-content: space-between; | |||
| font-size: 30rpx; | |||
| background-color: #fff; | |||
| border-radius: 20rpx; | |||
| padding: 30rpx; | |||
| margin: 10rpx auto; | |||
| } | |||
| .pickerInside { | |||
| color: #8a8a8a; | |||
| } | |||
| .distanceFoot { | |||
| font-size: 25rpx; | |||
| color: #3c89ff; | |||
| } | |||
| @@ -4,10 +4,12 @@ var app = getApp(); | |||
| const Http = require("../../../utils/HttpBasics"); | |||
| const util = require("../../../utils/util"); | |||
| const imgurl = require("../../../utils/imgurl"); | |||
| var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js'); | |||
| Page({ | |||
| data: { | |||
| priceAndStockObj: {},//存放价格和库存 | |||
| isGetUser: true,//判断是否授权抖音 | |||
| priceAndStockObj: {}, //存放价格和库存 | |||
| isGetUser: true, //判断是否授权抖音 | |||
| mouldType: 0, | |||
| navigationBarHeight, | |||
| homeSelectedO: imgurl.homeSelectedO.url, | |||
| @@ -92,10 +94,16 @@ Page({ | |||
| //图文混排 | |||
| curHtml: '', | |||
| contentType: 0, | |||
| page: 1,//查询商户优惠券page | |||
| page: 1, //查询商户优惠券page | |||
| idList: [], | |||
| showBox: false,//手机号授权框 | |||
| spuIdObj: {} | |||
| showBox: false, //手机号授权框 | |||
| spuIdObj: {}, | |||
| mallTenantId: '', | |||
| mallList: [], | |||
| imId: "", | |||
| goodId: "", | |||
| IMorderId: "", | |||
| use_num_per_consume: "" | |||
| }, | |||
| /** | |||
| @@ -106,6 +114,32 @@ Page({ | |||
| isshowposter: true, | |||
| }) | |||
| }, | |||
| imCallback(e) { | |||
| console.log("跳转IM客服成功", e); | |||
| }, | |||
| onimError(e) { | |||
| console.log("拉起IM客服失败", e.detail); | |||
| }, | |||
| getIm() { //获取im客服id | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getIm, | |||
| data: { | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getIm'); | |||
| const imId = res.data.imId || '' | |||
| that.setData({ | |||
| imId: imId | |||
| }) | |||
| }).catch(err => { | |||
| console.log(err, 'res'); | |||
| }) | |||
| }, | |||
| getCouponList: function (id) { //获取其他活动 | |||
| let that = this; | |||
| let data; | |||
| @@ -116,39 +150,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 +193,7 @@ Page({ | |||
| }) | |||
| }, | |||
| setPhone(paramData) {//子组件调用这个方法说明手机号已经授权成功 | |||
| setPhone(paramData) { //子组件调用这个方法说明手机号已经授权成功 | |||
| this.setData({ | |||
| showBox: paramData.detail, | |||
| }) | |||
| @@ -255,9 +289,9 @@ Page({ | |||
| let that = this; | |||
| // 获取用户信息 | |||
| Http.get({ | |||
| url: config.api.getScore, | |||
| data: {} | |||
| }) | |||
| url: config.api.getScore, | |||
| data: {} | |||
| }) | |||
| .then(res => { | |||
| console.log(res) | |||
| that.getQueryCardStatus() | |||
| @@ -275,12 +309,12 @@ Page({ | |||
| let param = { | |||
| id: this.data.cardData.couponOrderId, | |||
| cUserId: this.data.cardData.cuserId, | |||
| updateDate: util.formatTime(Number(that.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") | |||
| updateDate: util.timestampToTime(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) | |||
| }) | |||
| @@ -296,16 +330,16 @@ Page({ | |||
| let param = { | |||
| id: this.data.cardData.couponOrderId, | |||
| cUserId: this.data.cardData.cuserId, | |||
| updateDate: util.formatTime(Number(this.data.cardData.updateDate), "yyyy-MM-dd hh:mm:ss") | |||
| updateDate: util.timestampToTime(Number(this.data.cardData.updateDate), "YYYY-MM-DD hh:mm:ss") | |||
| } | |||
| this.setData({ | |||
| receivedDisabled: true | |||
| }) | |||
| Http.post({ | |||
| url: config.api.cardAccept, | |||
| data: param | |||
| }) | |||
| url: config.api.cardAccept, | |||
| data: param | |||
| }) | |||
| .then(res => { | |||
| tt.showToast({ | |||
| title: '领取成功!', | |||
| @@ -360,12 +394,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 +439,7 @@ Page({ | |||
| data: { | |||
| token: app.globalData.token | |||
| } | |||
| }).then(res => { | |||
| }).catch(err => { | |||
| }).then(res => {}).catch(err => { | |||
| if (err.code == 11004) { | |||
| this.setData({ | |||
| isGetUser: false | |||
| @@ -416,8 +449,9 @@ Page({ | |||
| }, | |||
| gotopay: function (e) { | |||
| const merOrderId = this.data.couponChannelId | |||
| tt.navigateTo({ | |||
| url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}`, | |||
| url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}&mallTenantId=${this.data.mallTenantId}&merOrderId=${merOrderId}`, | |||
| }) | |||
| return | |||
| }, | |||
| @@ -482,81 +516,132 @@ Page({ | |||
| /** | |||
| * 获取用户信息 | |||
| */ | |||
| onLoad(options) { | |||
| console.log(options); | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType, | |||
| }) | |||
| let that = this; | |||
| if (options.g) { | |||
| app.globalData.havePlayEd1 = true; | |||
| onLoad(option) { | |||
| let options = null | |||
| if (option.params) { | |||
| options = JSON.parse(option.params) | |||
| } else { | |||
| options = option | |||
| } | |||
| 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) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.couponHtmlDetail, | |||
| data: { | |||
| couponChannelId: couponChannelId | |||
| couponChannelId: couponChannelId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res) | |||
| if (res.code == 200 && res.data.html) { | |||
| const curHtml = decodeURI(res.data.html) | |||
| this.setData({ | |||
| curHtml: decodeURI(res.data.html) | |||
| curHtml, | |||
| }) | |||
| var temp = ttParse.wxParse('article', 'html', curHtml, that, 5); | |||
| app.globalData.curHtml = this.data.curHtml; | |||
| console.log(app.globalData.curHtml) | |||
| } | |||
| }) | |||
| }, | |||
| 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({ | |||
| spuIdObj: res.data | |||
| spuIdObj: res.data, | |||
| goodId: res.data.spuId | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| @@ -569,11 +654,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 +669,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 +703,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 +780,7 @@ Page({ | |||
| }); | |||
| var EndTime = res.data.validStartDate; | |||
| var NowTime = new Date().getTime(); | |||
| /** | |||
| * activityStatus==0 活动未开始 | |||
| * activityStatus==1 活动已开始 | |||
| @@ -704,7 +800,7 @@ Page({ | |||
| clearInterval(that.data.setInterval) | |||
| } | |||
| if (res.data.actStatus == 0) { | |||
| var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | |||
| var beginTime = util.timestampToTime(res.data.beginTime, "YYYY-MM-DD hh:mm:ss"); | |||
| if (util.timechuo(beginTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| beginTime: "活动已结束", | |||
| @@ -715,7 +811,7 @@ Page({ | |||
| }); | |||
| } | |||
| } else { | |||
| var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss"); | |||
| var endTime = util.timestampToTime(res.data.endTime, "YYYY-MM-DD hh:mm:ss"); | |||
| if (util.timechuo(endTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| endtime: "活动已结束", | |||
| @@ -734,8 +830,8 @@ Page({ | |||
| if (res.data.type == 10) { | |||
| that.setData({ | |||
| salePriceStr: res.data.salePriceStr, | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| pickEndDate: util.timestampToTime(res.data.pickEndDate, "YYYY-MM-DD"), | |||
| pickStartDate: util.timestampToTime(res.data.pickStartDate, "YYYY-MM-DD"), | |||
| priceStr: res.data.priceStr, | |||
| tailPriceStr: res.data.tailPriceStr, | |||
| origPriceStr: res.data.origPriceStr | |||
| @@ -743,10 +839,12 @@ Page({ | |||
| } | |||
| if (res.data.validType == 1) { | |||
| that.setData({ | |||
| validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"), | |||
| validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| soldStartTime: util.timestampToTime(res.data.soldStartTime, "YYYY-MM-DD") || null, | |||
| soldEndTime: util.timestampToTime(res.data.soldEndTime, "YYYY-MM-DD") || null, | |||
| validStartDate: util.timestampToTime(res.data.validStartDate, "YYYY-MM-DD"), | |||
| validEndDate: util.timestampToTime(res.data.validEndDate, "YYYY-MM-DD"), | |||
| pickStartDate: util.timestampToTime(res.data.pickStartDate, "YYYY-MM-DD"), | |||
| pickEndDate: util.timestampToTime(res.data.pickEndDate, "YYYY-MM-DD"), | |||
| }); | |||
| } else { | |||
| if (res.data.validDays) { | |||
| @@ -756,7 +854,7 @@ Page({ | |||
| } | |||
| } | |||
| if (res.data.itemGroup) { | |||
| let tempObj = this.data.data | |||
| @@ -777,16 +875,26 @@ Page({ | |||
| if (tempAppoinObj.need_appointment) { | |||
| let subscribeSing = ""; | |||
| if (tempAppoinObj.ahead_time_type == 1) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 2) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 3) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟预约` | |||
| } | |||
| tempObj.subscribeSing = subscribeSing | |||
| tempObj.subscribeSing = subscribeSing | |||
| } | |||
| } | |||
| if (item.key == "limit_use_rule") { | |||
| console.log(item, 'item'); | |||
| if (item.data != '') { | |||
| let tempAppoinObj = JSON.parse(item.data) | |||
| that.setData({ | |||
| use_num_per_consume: tempAppoinObj.use_num_per_consume || "" | |||
| }) | |||
| } | |||
| } | |||
| if (item.key == "Notification") { | |||
| if (item.data != '') { | |||
| tempObj.curLsit = JSON.parse(item.data) | |||
| @@ -810,7 +918,7 @@ Page({ | |||
| } | |||
| if (item.key == 'Description') { | |||
| if (item.key == 'Description' && item.isRequired) { | |||
| tempObj.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| @@ -818,16 +926,19 @@ 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 => { | |||
| console.log(err, 'err'); | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| @@ -855,14 +966,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 +1002,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 +1016,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) { | |||
| // 用户手机已加密 | |||
| @@ -927,8 +1039,9 @@ Page({ | |||
| * 发起支付 | |||
| */ | |||
| orderFunc(discount) { | |||
| const merOrderId = this.data.couponChannelId | |||
| tt.navigateTo({ | |||
| url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}`, | |||
| url: `/pages/coupon/confirmation/confirmation?couponChannelId=${this.data.couponChannelId}&mallTenantId=${this.data.mallTenantId}&merOrderId=${merOrderId}`, | |||
| }) | |||
| // return | |||
| @@ -978,7 +1091,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 +1116,8 @@ Page({ | |||
| onShow() { | |||
| this.ifGetUser()//判断是否授权抖音 | |||
| this.ifGetUser() //判断是否授权抖音 | |||
| this.getIm() | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType, | |||
| showbutton: false, | |||
| @@ -1031,7 +1145,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 +1157,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 | |||
| @@ -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 | |||
| } | |||
| @@ -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,40 +134,59 @@ | |||
| <!-- 适用门店 --> | |||
| <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> | |||
| <image tt:if="{{data.type == 69}}" class="alerting" mode='widthFix' src="../../../assets/images/appointment.png"> | |||
| </image> | |||
| <view class='notes'> | |||
| <view class="notesH">购买须知</view> | |||
| <view class="timeText">有效期</view> | |||
| <view class="notesH">购买须知</view> | |||
| <view class="timeText">使用期</view> | |||
| <view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view> | |||
| <view tt:if="{{soldStartTime && soldEndTime}}"> | |||
| <view class="timeText">售卖期</view> | |||
| <view class="Hchild">• {{soldStartTime}}至{{soldEndTime}}</view> | |||
| </view> | |||
| <view class="timeText">可用时间</view> | |||
| <view class="Hchild">• 商家营业时间内到店使用</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="timeText">购买限制</view> | |||
| <view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view> | |||
| <view class="Hchild" tt:if="{{data.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用 | |||
| </view> | |||
| <view tt:if="{{ order.useLimitQuantity }}" class="timeText">购买限制</view> | |||
| <view tt:if="{{ order.useLimitQuantity }}" class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</view> | |||
| <view tt:if="{{ use_num_per_consume }}" class="timeText">使用限制</view> | |||
| <view tt:if="{{ use_num_per_consume }}" class="Hchild">• 每个用户仅可用{{use_num_per_consume}}张</view> | |||
| <view class="timeText">预约消费</view> | |||
| <view class="Hchild" tt:if="{{!data.subscribeSing}}">• 无需预约,高峰时段可能等位</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="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 tt:if="{{ data.pack || data.besides || data.superimposed_discounts || data.private_room }}" | |||
| 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">使用规则</view> | |||
| <text tt:if="{{curHtml==''}}" class="notesText">{{data.remark}}</text> | |||
| <view tt:if="{{curHtml!=''}}"> | |||
| <rich-text nodes="{{curHtml}}"></rich-text> | |||
| <text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text> | |||
| <view tt:if="{{ contentType==1 }}"> | |||
| <import src="../../freeBannerDetail/ttParse/wxParse.ttml" /> | |||
| <view class="content" style="width: 750rpx;padding: 0 20rpx;"> | |||
| <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | |||
| </view> | |||
| </view> | |||
| <view tt:if="{{data.curLsit}}" tt:for="{{data.curLsit}}" tt:key="{{index}}"> | |||
| @@ -171,9 +194,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 +208,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 +238,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> | |||
| @@ -246,11 +270,14 @@ | |||
| <button class='buyX' disabled='true' tt:if="{{total_micro_second<=0&&data.activityStatus!=0}}">活动已结束</button> | |||
| <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" /> | |||
| <button tt:if="{{imId && goodId}}" class="serviceBox" open-type="im" data-im-id="{{ imId }}" | |||
| data-im-type="goods" data-biz-line="1" data-goods-id="{{ goodId }}" bindim="imCallback" binderror="onimError"> | |||
| <view class="fuwuLogoBox f"> | |||
| <image class="itemLogo" src="../../../assets/images/service1.png" /> | |||
| </view> | |||
| </button> | |||
| </view> | |||
| </form> | |||
| </view> | |||
| @@ -261,7 +288,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 +323,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 +371,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> | |||
| @@ -1,4 +1,6 @@ | |||
| @import "../../../app.ttss"; | |||
| @import "../../freeBannerDetail/ttParse/wxParse.ttss"; | |||
| page { | |||
| background: #f4f5f9; | |||
| @@ -6,9 +8,14 @@ page { | |||
| button::after { | |||
| border: none; | |||
| } | |||
| .content { | |||
| width: 710rpx; | |||
| padding: 0 20rpx; | |||
| background-color: #ffffff; | |||
| } | |||
| .coupons { | |||
| width: 100%; | |||
| @@ -217,11 +224,13 @@ button::after { | |||
| text-overflow: ellipsis; | |||
| padding-top: 30rpx; | |||
| } | |||
| .subTitleBox{ | |||
| .subTitleBox { | |||
| overflow: hidden; | |||
| width: 100%; | |||
| margin: 10rpx 0; | |||
| margin: 10rpx 0; | |||
| } | |||
| .subTitle { | |||
| display: block; | |||
| width: 400rpx; | |||
| @@ -235,7 +244,8 @@ button::after { | |||
| padding: 6rpx 0; | |||
| float: left; | |||
| } | |||
| .sellBox{ | |||
| .sellBox { | |||
| display: block; | |||
| font-size: 26rpx; | |||
| color: #a6a6a6; | |||
| @@ -333,7 +343,8 @@ button::after { | |||
| height: 32rpx; | |||
| line-height: 45rpx; | |||
| } | |||
| .qsOriginal{ | |||
| .qsOriginal { | |||
| text-decoration: line-through; | |||
| color: #999 !important; | |||
| margin-top: 58rpx; | |||
| @@ -344,11 +355,12 @@ button::after { | |||
| float: left; | |||
| } | |||
| .serviceImg{ | |||
| .serviceImg { | |||
| height: 100%; | |||
| width: 100%; | |||
| } | |||
| .timeText{ | |||
| .timeText { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 14px; | |||
| @@ -357,6 +369,7 @@ button::after { | |||
| width: 92%; | |||
| margin: 10rpx auto 0 auto; | |||
| } | |||
| .fl { | |||
| float: left; | |||
| } | |||
| @@ -364,20 +377,26 @@ button::after { | |||
| .fr { | |||
| float: right; | |||
| } | |||
| .notes { | |||
| width: 100%; | |||
| background: #fff; | |||
| padding-bottom: 30rpx; | |||
| } | |||
| .nodesD{ | |||
| .alerting { | |||
| width: 100%; | |||
| } | |||
| .nodesD { | |||
| height: 87rpx; | |||
| line-height: 87rpx; | |||
| background: #fff; | |||
| border-top: 1px solid #f9f9f9; | |||
| font-weight: bold; | |||
| } | |||
| .notesText{ | |||
| .notesText { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -388,15 +407,16 @@ button::after { | |||
| display: block; | |||
| } | |||
| .notesH{ | |||
| .notesH { | |||
| width: 92%; | |||
| font-weight: bold; | |||
| font-size: 32rpx; | |||
| color: #3c3c3c; | |||
| margin: 10rpx auto; | |||
| margin: 10rpx auto; | |||
| padding-top: 10rpx; | |||
| } | |||
| .Hchild{ | |||
| .Hchild { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -406,6 +426,7 @@ button::after { | |||
| line-height: 21px; | |||
| display: block; | |||
| } | |||
| /* .notes view:nth-child(1) text { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| @@ -441,11 +462,12 @@ button::after { | |||
| .app-border-topX{ | |||
| .app-border-topX { | |||
| width: 100%; | |||
| background-color: #fff; | |||
| border-top: solid 1rpx rgb(204, 204, 204); | |||
| } | |||
| .buy-view { | |||
| /* background: #fff; */ | |||
| height: 92rpx; | |||
| @@ -455,18 +477,22 @@ button::after { | |||
| padding-bottom: 22rpx; | |||
| padding-top: 22rpx; | |||
| } | |||
| .sell{ | |||
| .sell { | |||
| font-size: 24rpx; | |||
| color: #a6a6a6;; | |||
| color: #a6a6a6; | |||
| ; | |||
| letter-spacing: 1px; | |||
| text-align: right; | |||
| float: right; | |||
| margin-top: 60rpx; | |||
| } | |||
| .sellP{ | |||
| .sellP { | |||
| color: #d5af67; | |||
| } | |||
| .biaoz{ | |||
| .biaoz { | |||
| color: #d5af67; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 28rpx; | |||
| @@ -476,7 +502,8 @@ button::after { | |||
| margin-top: 55rpx; | |||
| margin-left: 40rpx; | |||
| } | |||
| .selling{ | |||
| .selling { | |||
| color: #d5af67; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 36rpx; | |||
| @@ -485,7 +512,8 @@ button::after { | |||
| margin-top: 50rpx; | |||
| /* line-height: 22px; */ | |||
| } | |||
| .buyX{ | |||
| .buyX { | |||
| /* position: relative; */ | |||
| float: right; | |||
| background: linear-gradient(270deg, #DDAB5A, #B8832D); | |||
| @@ -498,6 +526,7 @@ button::after { | |||
| border-radius: 61rpx; | |||
| margin: 30rpx 20rpx; | |||
| } | |||
| .buy { | |||
| position: relative; | |||
| background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); | |||
| @@ -672,7 +701,7 @@ button::after { | |||
| border-bottom: 1rpx solid #eee; | |||
| } | |||
| .quessss >view:last-child { | |||
| .quessss>view:last-child { | |||
| border-bottom: 0; | |||
| } | |||
| @@ -741,7 +770,8 @@ button::after { | |||
| bottom: 15rpx; | |||
| } | |||
| .btns .fr, .btns .fl { | |||
| .btns .fr, | |||
| .btns .fl { | |||
| width: 277rpx; | |||
| height: 95rpx; | |||
| border-radius: 48rpx; | |||
| @@ -909,7 +939,8 @@ button::after { | |||
| background: rgba(201, 201, 201, 0.1); | |||
| } | |||
| checkbox-group, radio-group { | |||
| checkbox-group, | |||
| radio-group { | |||
| height: 400rpx; | |||
| overflow-y: scroll; | |||
| } | |||
| @@ -927,14 +958,14 @@ checkbox-group, radio-group { | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .content { | |||
| /* .content { | |||
| margin: 0; | |||
| padding: 0; | |||
| width: 100%; | |||
| height: 100%; | |||
| background: #f3f3f3; | |||
| position: relative; | |||
| } | |||
| } */ | |||
| .poster { | |||
| width: 100%; | |||
| @@ -1103,10 +1134,11 @@ checkbox-group, radio-group { | |||
| .groupTitleBox{ | |||
| .groupTitleBox { | |||
| background: #fff; | |||
| } | |||
| .groupTitle{ | |||
| .groupTitle { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 30rpx; | |||
| @@ -1116,7 +1148,8 @@ checkbox-group, radio-group { | |||
| margin: 0 auto; | |||
| font-weight: bold; | |||
| } | |||
| .groupTitleS{ | |||
| .groupTitleS { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 28rpx; | |||
| @@ -1126,7 +1159,8 @@ checkbox-group, radio-group { | |||
| margin: 0 auto; | |||
| /* font-weight: bold; */ | |||
| } | |||
| .yuandian{ | |||
| .yuandian { | |||
| background-color: #333333; | |||
| width: 4rpx; | |||
| @@ -1135,57 +1169,68 @@ checkbox-group, radio-group { | |||
| margin: 16rpx 8rpx 0 0; | |||
| float: left; | |||
| } | |||
| .groupDetailsBox{ | |||
| .groupDetailsBox { | |||
| width: 90%; | |||
| margin: 0 auto; | |||
| } | |||
| .groupTiemBox{ | |||
| .groupTiemBox { | |||
| color: #333333; | |||
| overflow: hidden; | |||
| } | |||
| .groupTiemName{ | |||
| .groupTiemName { | |||
| float: left; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .groupTiemPay{ | |||
| .groupTiemPay { | |||
| float: right; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .videoCla{ | |||
| .videoCla { | |||
| margin-top: 10rpx; | |||
| width: 70rpx; | |||
| height: 60rpx; | |||
| } | |||
| .issue{ | |||
| .issue { | |||
| font-size: 20rpx; | |||
| } | |||
| .groupTextBox{ | |||
| .groupTextBox { | |||
| background: #fff; | |||
| overflow: hidden; | |||
| padding-bottom: 10rpx; | |||
| } | |||
| .shootBox{ | |||
| .shootBox { | |||
| position: fixed; | |||
| top: 70%; | |||
| right: 0; | |||
| width: 120rpx; | |||
| height: 100rpx; | |||
| background-color: rgba(221,171,90, 0.5) !important; | |||
| border-radius: 12rpx 0 0 12rpx; | |||
| background-color: rgba(221, 171, 90, 0.5) !important; | |||
| border-radius: 12rpx 0 0 12rpx; | |||
| z-index: 1000000; | |||
| } | |||
| .mount{ | |||
| .mount { | |||
| line-height: 20rpx !important; | |||
| height: 100%; | |||
| } | |||
| button{ | |||
| button { | |||
| color: #fff; | |||
| background-color: rgba(221,171,90, 0.5); | |||
| padding:0; | |||
| background-color: rgba(221, 171, 90, 0.5); | |||
| padding: 0; | |||
| } | |||
| .serviceBox{ | |||
| .serviceBox { | |||
| float: right; | |||
| margin-top: 58rpx; | |||
| margin-right: 14rpx; | |||
| @@ -1193,16 +1238,19 @@ button{ | |||
| width: 40rpx; | |||
| background-color: #fff; | |||
| } | |||
| .fuwuLogoBox{ | |||
| .fuwuLogoBox { | |||
| width: 40rpx; | |||
| height: 40rpx; | |||
| line-height: 0; | |||
| } | |||
| .itemLogo{ | |||
| .itemLogo { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .fuwuName{ | |||
| .fuwuName { | |||
| text-align: center; | |||
| color: #000; | |||
| font-size: 24rpx; | |||
| @@ -4,22 +4,30 @@ var app = getApp(); | |||
| const Http = require("../../../utils/HttpBasics"); | |||
| const util = require("../../../utils/util"); | |||
| const imgurl = require("../../../utils/imgurl"); | |||
| var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js'); | |||
| Page({ | |||
| data: { | |||
| couponIds:"", | |||
| couponChannelId:"", | |||
| showPage:false, | |||
| data:{}, | |||
| spuIdObj:{}, | |||
| priceAndStockObj:{}, | |||
| validStartDate:"", | |||
| validEndDate:"", | |||
| couponIds: "", | |||
| couponChannelId: "", | |||
| showPage: false, | |||
| data: {}, | |||
| spuIdObj: {}, | |||
| priceAndStockObj: {}, | |||
| validStartDate: "", | |||
| validEndDate: "", | |||
| contentType: "", | |||
| mallTenantId: '' | |||
| }, | |||
| onLoad: function (options) { | |||
| console.log(options.couponChannelId); | |||
| this.getDetail(options.couponChannelId) | |||
| const mallTenantId = tt.getStorageSync('mallTenantId'); | |||
| if (mallTenantId) { | |||
| this.setData({ | |||
| mallTenantId | |||
| }) | |||
| } | |||
| }, | |||
| getDetail: function (couponChannelId, flag) { | |||
| let that = this; | |||
| @@ -37,161 +45,189 @@ Page({ | |||
| }; | |||
| Http.get(parmer).then(res => { | |||
| that.setData({ | |||
| couponId: res.data.couponId | |||
| }) | |||
| if (res.data.contentType != undefined && res.data.contentType == 1) { | |||
| //获取图文展示详情html | |||
| that.setData({ | |||
| couponId: res.data.couponId | |||
| contentType: res.data.contentType | |||
| }) | |||
| /** | |||
| * activityStatus==0 活动未开始 | |||
| * activityStatus==1 活动已开始 | |||
| * flag == endclock 说明倒计时已经结束 | |||
| */ | |||
| if (res.data.endTime && res.data.beginTime) { | |||
| that.setData({ | |||
| begin_time: res.data.beginTime, | |||
| end_time: res.data.endTime, | |||
| activityStatus: res.data.actStatus ? res.data.actStatus : '' | |||
| }) | |||
| if (res.data.actStatus == 0 && flag != 'endclock') { | |||
| that.countdown(res.data.beginTime); | |||
| } else if (res.data.actStatus != 0 && flag != 'endclock') { | |||
| that.countdown(res.data.endTime); | |||
| that.getHtml(couponChannelId); | |||
| } | |||
| /** | |||
| * activityStatus==0 活动未开始 | |||
| * activityStatus==1 活动已开始 | |||
| * flag == endclock 说明倒计时已经结束 | |||
| */ | |||
| if (res.data.endTime && res.data.beginTime) { | |||
| that.setData({ | |||
| begin_time: res.data.beginTime, | |||
| end_time: res.data.endTime, | |||
| activityStatus: res.data.actStatus ? res.data.actStatus : '' | |||
| }) | |||
| if (res.data.actStatus == 0 && flag != 'endclock') { | |||
| that.countdown(res.data.beginTime); | |||
| } else if (res.data.actStatus != 0 && flag != 'endclock') { | |||
| that.countdown(res.data.endTime); | |||
| } else { | |||
| clearInterval(that.data.setInterval) | |||
| } | |||
| if (res.data.actStatus == 0) { | |||
| var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | |||
| if (util.timechuo(beginTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| beginTime: "活动已结束", | |||
| }); | |||
| } else { | |||
| clearInterval(that.data.setInterval) | |||
| that.setData({ | |||
| beginTime: util.timechuo(beginTime) | |||
| }); | |||
| } | |||
| if (res.data.actStatus == 0) { | |||
| var beginTime = util.formatTime(res.data.beginTime, "yyyy-MM-dd hh:mm:ss"); | |||
| if (util.timechuo(beginTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| beginTime: "活动已结束", | |||
| }); | |||
| } else { | |||
| that.setData({ | |||
| beginTime: util.timechuo(beginTime) | |||
| }); | |||
| } | |||
| } else { | |||
| var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss"); | |||
| if (util.timechuo(endTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| endtime: "活动已结束", | |||
| }); | |||
| } else { | |||
| var endTime = util.formatTime(res.data.endTime, "yyyy-MM-dd hh:mm:ss"); | |||
| if (util.timechuo(endTime).indexOf('-') == 0) { | |||
| that.setData({ | |||
| endtime: "活动已结束", | |||
| }); | |||
| } else { | |||
| that.setData({ | |||
| endtime: util.timechuo(endTime) | |||
| }); | |||
| } | |||
| that.setData({ | |||
| endtime: util.timechuo(endTime) | |||
| }); | |||
| } | |||
| } | |||
| tt.hideLoading(); | |||
| } | |||
| tt.hideLoading(); | |||
| that.setData({ | |||
| data: res.data, | |||
| }); | |||
| if (res.data.type == 10) { | |||
| that.setData({ | |||
| data: res.data, | |||
| salePriceStr: res.data.salePriceStr, | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| priceStr: res.data.priceStr, | |||
| tailPriceStr: res.data.tailPriceStr, | |||
| origPriceStr: res.data.origPriceStr | |||
| }) | |||
| } | |||
| if (res.data.validType == 1) { | |||
| that.setData({ | |||
| soldStartTime: util.timestampToTime(res.data.soldStartTime, "YYYY-MM-DD") || null, | |||
| soldEndTime: util.timestampToTime(res.data.soldEndTime, "YYYY-MM-DD") || null, | |||
| validStartDate: util.timestampToTime(res.data.validStartDate, "YYYY-MM-DD"), | |||
| validEndDate: util.timestampToTime(res.data.validEndDate, "YYYY-MM-DD"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| }); | |||
| if (res.data.type == 10) { | |||
| that.setData({ | |||
| salePriceStr: res.data.salePriceStr, | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| priceStr: res.data.priceStr, | |||
| tailPriceStr: res.data.tailPriceStr, | |||
| origPriceStr: res.data.origPriceStr | |||
| }) | |||
| } | |||
| if (res.data.validType == 1) { | |||
| } else { | |||
| if (res.data.validDays) { | |||
| that.setData({ | |||
| validStartDate: util.formatTime(res.data.validStartDate, "yyyy-MM-dd"), | |||
| validEndDate: util.formatTime(res.data.validEndDate, "yyyy-MM-dd"), | |||
| pickStartDate: util.formatTime(res.data.pickStartDate, "yyyy-MM-dd"), | |||
| pickEndDate: util.formatTime(res.data.pickEndDate, "yyyy-MM-dd"), | |||
| validDays: res.data.validDays | |||
| }); | |||
| } else { | |||
| if (res.data.validDays) { | |||
| that.setData({ | |||
| validDays: res.data.validDays | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| if (res.data.itemGroup) { | |||
| let tempObj = this.data.data | |||
| tempObj.itemGroup = JSON.parse(tempObj.itemGroup) | |||
| this.setData({ | |||
| data: tempObj | |||
| }) | |||
| console.log(this.data.data, "data"); | |||
| } | |||
| if (res.data.itemGroup) { | |||
| let tempObj = this.data.data | |||
| tempObj.itemGroup = JSON.parse(tempObj.itemGroup) | |||
| this.setData({ | |||
| data: tempObj | |||
| }) | |||
| console.log(this.data.data, "data"); | |||
| } | |||
| if (res.data.productAttrs && res.data.skuAttrs) { | |||
| let tempObj = this.data.data | |||
| tempObj.productAttrs = JSON.parse(tempObj.productAttrs) | |||
| tempObj.skuAttrs = JSON.parse(tempObj.skuAttrs) | |||
| tempObj.productAttrs.map(item => { | |||
| if (res.data.productAttrs && res.data.skuAttrs) { | |||
| let tempObj = this.data.data | |||
| 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) { | |||
| let subscribeSing = ""; | |||
| if (tempAppoinObj.ahead_time_type == 1) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天致电商家预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 2) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时致电商家预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 3) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟致电商家预约` | |||
| } | |||
| tempObj.subscribeSing = subscribeSing | |||
| if (item.key == "appointment") { | |||
| let tempAppoinObj = JSON.parse(item.data) | |||
| if (tempAppoinObj.need_appointment) { | |||
| let subscribeSing = ""; | |||
| if (tempAppoinObj.ahead_time_type == 1) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 2) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 3) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟预约` | |||
| } | |||
| tempObj.subscribeSing = subscribeSing | |||
| } | |||
| if (item.key == "Notification") { | |||
| if (item.data != '') { | |||
| tempObj.curLsit = JSON.parse(item.data) | |||
| } | |||
| } | |||
| if (item.key == "bring_out_meal") { | |||
| tempObj.besides = item.data | |||
| } | |||
| if (item.key == "free_pack") { | |||
| tempObj.pack = item.data | |||
| } | |||
| } | |||
| if (item.key == "superimposed_discounts") { | |||
| tempObj.superimposed_discounts = item.data | |||
| } | |||
| if (item.key == "private_room") { | |||
| tempObj.private_room = item.data | |||
| } | |||
| if (item.key == "rec_person_num_max") { | |||
| tempObj.rec_person_num_max = item.data | |||
| if (item.key == "Notification") { | |||
| if (item.data != '') { | |||
| tempObj.curLsit = JSON.parse(item.data) | |||
| } | |||
| } | |||
| if (item.key == "bring_out_meal") { | |||
| tempObj.besides = item.data | |||
| } | |||
| if (item.key == "free_pack") { | |||
| tempObj.pack = item.data | |||
| } | |||
| if (item.key == "superimposed_discounts") { | |||
| tempObj.superimposed_discounts = item.data | |||
| } | |||
| if (item.key == "private_room") { | |||
| tempObj.private_room = item.data | |||
| } | |||
| if (item.key == "rec_person_num_max") { | |||
| tempObj.rec_person_num_max = item.data | |||
| } | |||
| if (item.key == 'Description') { | |||
| tempObj.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| tempObj.can_no_use_date = JSON.parse(item.data) | |||
| } | |||
| }) | |||
| tempObj.skuAttrs.map(item => { | |||
| if (item.key == "commodity") { | |||
| if (item.data != '') { | |||
| tempObj.itemGroup = JSON.parse(item.data) | |||
| } | |||
| if (item.key == 'Description' && item.isRequired) { | |||
| tempObj.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| tempObj.can_no_use_date = JSON.parse(item.data) | |||
| } | |||
| }) | |||
| tempObj.skuAttrs.map(item => { | |||
| if (item.key == "commodity") { | |||
| if (item.data != '') { | |||
| tempObj.itemGroup = JSON.parse(item.data) | |||
| } | |||
| }) | |||
| this.setData({ | |||
| data: tempObj | |||
| }) | |||
| console.log(this.data.data, "data"); | |||
| } | |||
| }).catch(err => { | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| } | |||
| }) | |||
| this.setData({ | |||
| data: tempObj | |||
| }) | |||
| console.log(this.data.data, "data"); | |||
| } | |||
| }).catch(err => { | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none', | |||
| duration: 2000, | |||
| mask: false | |||
| }); | |||
| }) | |||
| }, | |||
| getHtml(couponChannelId) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.couponHtmlDetail, | |||
| data: { | |||
| couponChannelId: couponChannelId, | |||
| mallTenantId: that.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res) | |||
| if (res.code == 200 && res.data.html) { | |||
| const curHtml = decodeURI(res.data.html) | |||
| var temp = ttParse.wxParse('article', 'html', curHtml, that, 5); | |||
| } | |||
| }) | |||
| }, | |||
| }) | |||
| @@ -1,39 +1,51 @@ | |||
| <view class='notes'> | |||
| <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="timeText">购买限制</view> | |||
| <view class="Hchild">• 每个用户限购{{data.useLimitQuantity}}单</view> | |||
| <view class="timeText">预约消费</view> | |||
| <!-- <view class="Hchild">• 无需预约,高峰时段可能等位</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.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> | |||
| <view class="notesH">使用规则</view> | |||
| <text tt:if="{{curHtml==''}}" class="notesText">{{data.remark}}</text> | |||
| <view tt:if="{{curHtml!=''}}"> | |||
| <rich-text nodes="{{curHtml}}"></rich-text> | |||
| </view> | |||
| <view class="notesH">购买须知</view> | |||
| <view class="timeText">使用期</view> | |||
| <view class="Hchild">• {{validStartDate}}至{{validEndDate}}</view> | |||
| <view tt:if="{{soldStartTime && soldEndTime}}"> | |||
| <view class="timeText">售卖期</view> | |||
| <view class="Hchild">• {{soldStartTime}}至{{soldEndTime}}</view> | |||
| </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 tt:if="{{ order.useLimitQuantity }}" class="timeText">购买限制</view> | |||
| <view tt:if="{{ order.useLimitQuantity }}" class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</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 class="timeText">预约消费</view> | |||
| <!-- <view class="Hchild">• 无需预约,高峰时段可能等位</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 tt:if="{{ data.pack || data.besides || data.superimposed_discounts || data.private_room }}" 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.private_room}}">• {{data.private_room=="false"?'不可以使用':'可以使用'}}包间</view> | |||
| <view class="notesH">使用规则</view> | |||
| <text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text> | |||
| <view tt:if="{{ contentType==1 }}"> | |||
| <import src="../../freeBannerDetail/ttParse/wxParse.ttml" /> | |||
| <view class="content" style="width: 750rpx;padding: 0 20rpx;"> | |||
| <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | |||
| </view> | |||
| </view> | |||
| </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> | |||
| @@ -1,4 +1,5 @@ | |||
| @import "../../../app.ttss"; | |||
| @import "../../freeBannerDetail/ttParse/wxParse.ttss"; | |||
| page { | |||
| background: #f4f5f9; | |||
| @@ -6,9 +7,14 @@ page { | |||
| button::after { | |||
| border: none; | |||
| } | |||
| .content { | |||
| width: 710rpx; | |||
| padding: 0 20rpx; | |||
| background-color: #ffffff; | |||
| } | |||
| .coupons { | |||
| width: 100%; | |||
| @@ -217,11 +223,13 @@ button::after { | |||
| text-overflow: ellipsis; | |||
| padding-top: 30rpx; | |||
| } | |||
| .subTitleBox{ | |||
| .subTitleBox { | |||
| overflow: hidden; | |||
| width: 100%; | |||
| margin: 10rpx 0; | |||
| margin: 10rpx 0; | |||
| } | |||
| .subTitle { | |||
| display: block; | |||
| width: 400rpx; | |||
| @@ -235,7 +243,8 @@ button::after { | |||
| padding: 6rpx 0; | |||
| float: left; | |||
| } | |||
| .sellBox{ | |||
| .sellBox { | |||
| display: block; | |||
| font-size: 26rpx; | |||
| color: #a6a6a6; | |||
| @@ -333,7 +342,8 @@ button::after { | |||
| height: 32rpx; | |||
| line-height: 45rpx; | |||
| } | |||
| .qsOriginal{ | |||
| .qsOriginal { | |||
| text-decoration: line-through; | |||
| color: #999 !important; | |||
| margin-top: 58rpx; | |||
| @@ -344,11 +354,12 @@ button::after { | |||
| float: left; | |||
| } | |||
| .serviceImg{ | |||
| .serviceImg { | |||
| height: 100%; | |||
| width: 100%; | |||
| } | |||
| .timeText{ | |||
| .timeText { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 14px; | |||
| @@ -357,6 +368,7 @@ button::after { | |||
| width: 92%; | |||
| margin: 10rpx auto 0 auto; | |||
| } | |||
| .fl { | |||
| float: left; | |||
| } | |||
| @@ -364,20 +376,22 @@ button::after { | |||
| .fr { | |||
| float: right; | |||
| } | |||
| .notes { | |||
| width: 100%; | |||
| background: #fff; | |||
| padding-bottom: 30rpx; | |||
| } | |||
| .nodesD{ | |||
| .nodesD { | |||
| height: 87rpx; | |||
| line-height: 87rpx; | |||
| background: #fff; | |||
| border-top: 1px solid #f9f9f9; | |||
| font-weight: bold; | |||
| } | |||
| .notesText{ | |||
| .notesText { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -388,15 +402,16 @@ button::after { | |||
| display: block; | |||
| } | |||
| .notesH{ | |||
| .notesH { | |||
| width: 92%; | |||
| font-weight: bold; | |||
| font-size: 32rpx; | |||
| color: #3c3c3c; | |||
| margin: 10rpx auto; | |||
| margin: 10rpx auto; | |||
| padding-top: 10rpx; | |||
| } | |||
| .Hchild{ | |||
| .Hchild { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -406,6 +421,7 @@ button::after { | |||
| line-height: 21px; | |||
| display: block; | |||
| } | |||
| /* .notes view:nth-child(1) text { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| @@ -441,11 +457,12 @@ button::after { | |||
| .app-border-topX{ | |||
| .app-border-topX { | |||
| width: 100%; | |||
| background-color: #fff; | |||
| border-top: solid 1rpx rgb(204, 204, 204); | |||
| } | |||
| .buy-view { | |||
| /* background: #fff; */ | |||
| height: 92rpx; | |||
| @@ -455,18 +472,22 @@ button::after { | |||
| padding-bottom: 22rpx; | |||
| padding-top: 22rpx; | |||
| } | |||
| .sell{ | |||
| .sell { | |||
| font-size: 24rpx; | |||
| color: #a6a6a6;; | |||
| color: #a6a6a6; | |||
| ; | |||
| letter-spacing: 1px; | |||
| text-align: right; | |||
| float: right; | |||
| margin-top: 60rpx; | |||
| } | |||
| .sellP{ | |||
| .sellP { | |||
| color: #d5af67; | |||
| } | |||
| .biaoz{ | |||
| .biaoz { | |||
| color: #d5af67; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 28rpx; | |||
| @@ -476,7 +497,8 @@ button::after { | |||
| margin-top: 55rpx; | |||
| margin-left: 40rpx; | |||
| } | |||
| .selling{ | |||
| .selling { | |||
| color: #d5af67; | |||
| font-family: "PingFangSC-Medium"; | |||
| font-size: 36rpx; | |||
| @@ -485,7 +507,8 @@ button::after { | |||
| margin-top: 50rpx; | |||
| /* line-height: 22px; */ | |||
| } | |||
| .buyX{ | |||
| .buyX { | |||
| /* position: relative; */ | |||
| float: right; | |||
| background: linear-gradient(270deg, #DDAB5A, #B8832D); | |||
| @@ -498,6 +521,7 @@ button::after { | |||
| border-radius: 61rpx; | |||
| margin: 30rpx 20rpx; | |||
| } | |||
| .buy { | |||
| position: relative; | |||
| background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%); | |||
| @@ -672,7 +696,7 @@ button::after { | |||
| border-bottom: 1rpx solid #eee; | |||
| } | |||
| .quessss >view:last-child { | |||
| .quessss>view:last-child { | |||
| border-bottom: 0; | |||
| } | |||
| @@ -741,7 +765,8 @@ button::after { | |||
| bottom: 15rpx; | |||
| } | |||
| .btns .fr, .btns .fl { | |||
| .btns .fr, | |||
| .btns .fl { | |||
| width: 277rpx; | |||
| height: 95rpx; | |||
| border-radius: 48rpx; | |||
| @@ -909,7 +934,8 @@ button::after { | |||
| background: rgba(201, 201, 201, 0.1); | |||
| } | |||
| checkbox-group, radio-group { | |||
| checkbox-group, | |||
| radio-group { | |||
| height: 400rpx; | |||
| overflow-y: scroll; | |||
| } | |||
| @@ -927,14 +953,14 @@ checkbox-group, radio-group { | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .content { | |||
| /* .content { | |||
| margin: 0; | |||
| padding: 0; | |||
| width: 100%; | |||
| height: 100%; | |||
| background: #f3f3f3; | |||
| position: relative; | |||
| } | |||
| } */ | |||
| .poster { | |||
| width: 100%; | |||
| @@ -1103,10 +1129,11 @@ checkbox-group, radio-group { | |||
| .groupTitleBox{ | |||
| .groupTitleBox { | |||
| background: #fff; | |||
| } | |||
| .groupTitle{ | |||
| .groupTitle { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 30rpx; | |||
| @@ -1116,7 +1143,8 @@ checkbox-group, radio-group { | |||
| margin: 0 auto; | |||
| font-weight: bold; | |||
| } | |||
| .groupTitleS{ | |||
| .groupTitleS { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 28rpx; | |||
| @@ -1126,7 +1154,8 @@ checkbox-group, radio-group { | |||
| margin: 0 auto; | |||
| /* font-weight: bold; */ | |||
| } | |||
| .yuandian{ | |||
| .yuandian { | |||
| background-color: #333333; | |||
| width: 4rpx; | |||
| @@ -1135,57 +1164,68 @@ checkbox-group, radio-group { | |||
| margin: 16rpx 8rpx 0 0; | |||
| float: left; | |||
| } | |||
| .groupDetailsBox{ | |||
| .groupDetailsBox { | |||
| width: 90%; | |||
| margin: 0 auto; | |||
| } | |||
| .groupTiemBox{ | |||
| .groupTiemBox { | |||
| color: #333333; | |||
| overflow: hidden; | |||
| } | |||
| .groupTiemName{ | |||
| .groupTiemName { | |||
| float: left; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .groupTiemPay{ | |||
| .groupTiemPay { | |||
| float: right; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .videoCla{ | |||
| .videoCla { | |||
| margin-top: 10rpx; | |||
| width: 70rpx; | |||
| height: 60rpx; | |||
| } | |||
| .issue{ | |||
| .issue { | |||
| font-size: 20rpx; | |||
| } | |||
| .groupTextBox{ | |||
| .groupTextBox { | |||
| background: #fff; | |||
| overflow: hidden; | |||
| padding-bottom: 10rpx; | |||
| } | |||
| .shootBox{ | |||
| .shootBox { | |||
| position: fixed; | |||
| top: 70%; | |||
| right: 0; | |||
| width: 120rpx; | |||
| height: 100rpx; | |||
| background-color: rgba(221,171,90, 0.5) !important; | |||
| border-radius: 12rpx 0 0 12rpx; | |||
| background-color: rgba(221, 171, 90, 0.5) !important; | |||
| border-radius: 12rpx 0 0 12rpx; | |||
| z-index: 1000000; | |||
| } | |||
| .mount{ | |||
| .mount { | |||
| line-height: 20rpx !important; | |||
| height: 100%; | |||
| } | |||
| button{ | |||
| button { | |||
| color: #fff; | |||
| background-color: rgba(221,171,90, 0.5); | |||
| padding:0; | |||
| background-color: rgba(221, 171, 90, 0.5); | |||
| padding: 0; | |||
| } | |||
| .serviceBox{ | |||
| .serviceBox { | |||
| float: right; | |||
| margin-top: 58rpx; | |||
| margin-right: 14rpx; | |||
| @@ -1193,16 +1233,19 @@ button{ | |||
| width: 40rpx; | |||
| background-color: #fff; | |||
| } | |||
| .fuwuLogoBox{ | |||
| .fuwuLogoBox { | |||
| width: 40rpx; | |||
| height: 40rpx; | |||
| line-height: 0; | |||
| } | |||
| .itemLogo{ | |||
| .itemLogo { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .fuwuName{ | |||
| .fuwuName { | |||
| text-align: center; | |||
| color: #000; | |||
| font-size: 24rpx; | |||
| @@ -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, | |||
| @@ -71,35 +106,51 @@ Page({ | |||
| curHtml: decodeURI(res.data.html) | |||
| }) | |||
| // app.globalData.curHtml = this.data.curHtml; | |||
| // console.log(app.globalData.curHtml) | |||
| // | |||
| } | |||
| }) | |||
| }, | |||
| 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 | |||
| }) | |||
| @@ -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" | |||
| } | |||
| } | |||
| @@ -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> | |||
| @@ -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() | |||
| } | |||
| } | |||
| }) | |||
| @@ -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}}" /> | |||
| @@ -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; | |||
| } | |||
| @@ -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> | |||
| @@ -0,0 +1,49 @@ | |||
| let config = require("../../config/config.js"); | |||
| const extConfig = tt.getExtConfigSync ? tt.getExtConfigSync().extConfig : {} | |||
| let configUrls = extConfig.attr.configUrl; | |||
| let app = getApp(); | |||
| var ttParse = require('./ttParse/wxParse.js'); | |||
| Page({ | |||
| data: { | |||
| nodeData: "", | |||
| date: "", | |||
| mallTenantId: "" | |||
| }, | |||
| onLoad: function (options) { | |||
| const that = this | |||
| const date = new Date() | |||
| that.setData({ | |||
| date, | |||
| mallTenantId: tt.getStorageSync('mallTenantId') || "" | |||
| }) | |||
| if (options.id) { | |||
| that.getHtmlData(options.id) | |||
| } | |||
| }, | |||
| getHtmlData(id) { | |||
| const that = this | |||
| tt.request({ | |||
| url: configUrls + config.api.printHtmlById, | |||
| data: { | |||
| token: app.globalData.token, | |||
| id, | |||
| date: that.data.date, | |||
| mallTenantId: that.data.mallTenantId | |||
| }, | |||
| header: { | |||
| 'content-type': 'application/html' | |||
| }, | |||
| success: function (res) { | |||
| console.log(res, 'res'); | |||
| if (res.data) { | |||
| console.log(res.data, 'html'); | |||
| var temp = ttParse.wxParse('article', 'html', res.data, that, 5); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| }) | |||
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,5 @@ | |||
| <!-- \pages\freeBannerDetail\freeBannerDetail.ttml --> | |||
| <import src="./ttParse/wxParse.ttml" /> | |||
| <view class="content"> | |||
| <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | |||
| </view> | |||
| @@ -0,0 +1,6 @@ | |||
| @import "./ttParse/wxParse.ttss"; | |||
| .content { | |||
| width: 710rpx; | |||
| padding: 0 20rpx; | |||
| } | |||
| @@ -0,0 +1,318 @@ | |||
| /** | |||
| * html2Json 改造来自: https://github.com/Jxck/html2json | |||
| * | |||
| * | |||
| * author: Di (微信小程序开发工程师) | |||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||
| * 垂直微信小程序开发交流社区 | |||
| * | |||
| * github地址: https://github.com/icindy/wxParse | |||
| * | |||
| * for: 微信小程序富文本解析 | |||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||
| */ | |||
| var __placeImgeUrlHttps = "https"; | |||
| var __emojisReg = ''; | |||
| var __emojisBaseSrc = ''; | |||
| var __emojis = {}; | |||
| var wxDiscode = require('./wxDiscode.js'); | |||
| var HTMLParser = require('./htmlparser.js'); | |||
| // Empty Elements - HTML 5 | |||
| var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); | |||
| // Block Elements - HTML 5 | |||
| var block = makeMap("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); | |||
| // Inline Elements - HTML 5 | |||
| var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); | |||
| // Elements that you can, intentionally, leave open | |||
| // (and which close themselves) | |||
| var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); | |||
| // Attributes that have their values filled in disabled="disabled" | |||
| var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); | |||
| // Special Elements (can contain anything) | |||
| var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); | |||
| function makeMap(str) { | |||
| var obj = {}, items = str.split(","); | |||
| for (var i = 0; i < items.length; i++) | |||
| obj[items[i]] = true; | |||
| return obj; | |||
| } | |||
| function q(v) { | |||
| return '"' + v + '"'; | |||
| } | |||
| function removeDOCTYPE(html) { | |||
| return html | |||
| .replace(/<\?xml.*\?>\n/, '') | |||
| .replace(/<.*!doctype.*\>\n/, '') | |||
| .replace(/<.*!DOCTYPE.*\>\n/, ''); | |||
| } | |||
| function trimHtml(html) { | |||
| return html | |||
| .replace(/\r?\n+/g, '') | |||
| .replace(/<!--.*?-->/ig, '') | |||
| .replace(/\/\*.*?\*\//ig, '') | |||
| .replace(/[ ]+</ig, '<') | |||
| } | |||
| function html2json(html, bindName) { | |||
| //处理字符串 | |||
| html = removeDOCTYPE(html); | |||
| html = trimHtml(html); | |||
| html = wxDiscode.strDiscode(html); | |||
| //生成node节点 | |||
| var bufArray = []; | |||
| var results = { | |||
| node: bindName, | |||
| nodes: [], | |||
| images:[], | |||
| imageUrls:[] | |||
| }; | |||
| var index = 0; | |||
| HTMLParser(html, { | |||
| start: function (tag, attrs, unary) { | |||
| //debug(tag, attrs, unary); | |||
| // node for this element | |||
| var node = { | |||
| node: 'element', | |||
| tag: tag, | |||
| attr:{} | |||
| }; | |||
| if (node.tag =="embed"){ | |||
| console.log(node,attrs,unary,666) | |||
| var embUrl = ''; | |||
| attrs.map((item,index)=>{ | |||
| if(item.name == 'src'){ | |||
| embUrl = item.value | |||
| } | |||
| }) | |||
| // if (node.attr.src.indexOf('http:')==-1){ | |||
| // embUrl = "http://xxxx.com" + node.attr.src; | |||
| // } | |||
| node.attr.src = embUrl; | |||
| node.tag='video'; | |||
| } | |||
| if (bufArray.length === 0) { | |||
| node.index = index.toString() | |||
| index += 1 | |||
| } else { | |||
| var parent = bufArray[0]; | |||
| if (parent.nodes === undefined) { | |||
| parent.nodes = []; | |||
| } | |||
| node.index = parent.index + '.' + parent.nodes.length | |||
| } | |||
| if (block[tag]) { | |||
| node.tagType = "block"; | |||
| } else if (inline[tag]) { | |||
| node.tagType = "inline"; | |||
| } else if (closeSelf[tag]) { | |||
| node.tagType = "closeSelf"; | |||
| } | |||
| if (attrs.length !== 0) { | |||
| node.attr = attrs.reduce(function (pre, attr) { | |||
| var name = attr.name; | |||
| var value = attr.value; | |||
| if (name == 'class') { | |||
| console.dir(value); | |||
| // value = value.join("") | |||
| node.classStr = value; | |||
| } | |||
| // has multi attibutes | |||
| // make it array of attribute | |||
| if (name == 'style') { | |||
| console.dir(value); | |||
| // value = value.join("") | |||
| node.styleStr = value; | |||
| } | |||
| if (value.match(/ /)) { | |||
| value = value.split(' '); | |||
| } | |||
| // if attr already exists | |||
| // merge it | |||
| if (pre[name]) { | |||
| if (Array.isArray(pre[name])) { | |||
| // already array, push to last | |||
| pre[name].push(value); | |||
| } else { | |||
| // single value, make it array | |||
| pre[name] = [pre[name], value]; | |||
| } | |||
| } else { | |||
| // not exist, put it | |||
| pre[name] = value; | |||
| } | |||
| return pre; | |||
| }, {}); | |||
| } | |||
| //对img添加额外数据 | |||
| if (node.tag === 'img') { | |||
| node.imgIndex = results.images.length; | |||
| var imgUrl = node.attr.src; | |||
| if (imgUrl[0] == '') { | |||
| imgUrl.splice(0, 1); | |||
| } | |||
| imgUrl = wxDiscode.urlToHttpUrl(imgUrl, __placeImgeUrlHttps); | |||
| node.attr.src = imgUrl; | |||
| node.from = bindName; | |||
| results.images.push(node); | |||
| results.imageUrls.push(imgUrl); | |||
| } | |||
| // 处理font标签样式属性 | |||
| if (node.tag === 'font') { | |||
| var fontSize = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; | |||
| var styleAttrs = { | |||
| 'color': 'color', | |||
| 'face': 'font-family', | |||
| 'size': 'font-size' | |||
| }; | |||
| if (!node.attr.style) node.attr.style = []; | |||
| if (!node.styleStr) node.styleStr = ''; | |||
| for (var key in styleAttrs) { | |||
| if (node.attr[key]) { | |||
| var value = key === 'size' ? fontSize[node.attr[key]-1] : node.attr[key]; | |||
| node.attr.style.push(styleAttrs[key]); | |||
| node.attr.style.push(value); | |||
| node.styleStr += styleAttrs[key] + ': ' + value + ';'; | |||
| } | |||
| } | |||
| } | |||
| //临时记录source资源 | |||
| if(node.tag === 'source'){ | |||
| results.source = node.attr.src; | |||
| } | |||
| if (unary) { | |||
| // if this tag doesn't have end tag | |||
| // like <img src="hoge.png"/> | |||
| // add to parents | |||
| var parent = bufArray[0] || results; | |||
| if (parent.nodes === undefined) { | |||
| parent.nodes = []; | |||
| } | |||
| parent.nodes.push(node); | |||
| } else { | |||
| bufArray.unshift(node); | |||
| } | |||
| }, | |||
| end: function (tag) { | |||
| //debug(tag); | |||
| // merge into parent tag | |||
| var node = bufArray.shift(); | |||
| if (node.tag !== tag) console.error('invalid state: mismatch end tag'); | |||
| //当有缓存source资源时于于video补上src资源 | |||
| if(node.tag === 'video' && results.source){ | |||
| node.attr.src = results.source; | |||
| delete results.source; | |||
| } | |||
| if (bufArray.length === 0) { | |||
| results.nodes.push(node); | |||
| } else { | |||
| var parent = bufArray[0]; | |||
| if (parent.nodes === undefined) { | |||
| parent.nodes = []; | |||
| } | |||
| parent.nodes.push(node); | |||
| } | |||
| }, | |||
| chars: function (text) { | |||
| //debug(text); | |||
| var node = { | |||
| node: 'text', | |||
| text: text, | |||
| textArray:transEmojiStr(text) | |||
| }; | |||
| if (bufArray.length === 0) { | |||
| node.index = index.toString() | |||
| index += 1 | |||
| results.nodes.push(node); | |||
| } else { | |||
| var parent = bufArray[0]; | |||
| if (parent.nodes === undefined) { | |||
| parent.nodes = []; | |||
| } | |||
| node.index = parent.index + '.' + parent.nodes.length | |||
| parent.nodes.push(node); | |||
| } | |||
| }, | |||
| comment: function (text) { | |||
| //debug(text); | |||
| // var node = { | |||
| // node: 'comment', | |||
| // text: text, | |||
| // }; | |||
| // var parent = bufArray[0]; | |||
| // if (parent.nodes === undefined) { | |||
| // parent.nodes = []; | |||
| // } | |||
| // parent.nodes.push(node); | |||
| }, | |||
| }); | |||
| return results; | |||
| }; | |||
| function transEmojiStr(str){ | |||
| // var eReg = new RegExp("["+__reg+' '+"]"); | |||
| // str = str.replace(/\[([^\[\]]+)\]/g,':$1:') | |||
| var emojiObjs = []; | |||
| //如果正则表达式为空 | |||
| if(__emojisReg.length == 0 || !__emojis){ | |||
| var emojiObj = {} | |||
| emojiObj.node = "text"; | |||
| emojiObj.text = str; | |||
| array = [emojiObj]; | |||
| return array; | |||
| } | |||
| //这个地方需要调整 | |||
| str = str.replace(/\[([^\[\]]+)\]/g,':$1:') | |||
| var eReg = new RegExp("[:]"); | |||
| var array = str.split(eReg); | |||
| for(var i = 0; i < array.length; i++){ | |||
| var ele = array[i]; | |||
| var emojiObj = {}; | |||
| if(__emojis[ele]){ | |||
| emojiObj.node = "element"; | |||
| emojiObj.tag = "emoji"; | |||
| emojiObj.text = __emojis[ele]; | |||
| emojiObj.baseSrc= __emojisBaseSrc; | |||
| }else{ | |||
| emojiObj.node = "text"; | |||
| emojiObj.text = ele; | |||
| } | |||
| emojiObjs.push(emojiObj); | |||
| } | |||
| return emojiObjs; | |||
| } | |||
| function emojisInit(reg='',baseSrc="/wxParse/emojis/",emojis){ | |||
| __emojisReg = reg; | |||
| __emojisBaseSrc=baseSrc; | |||
| __emojis=emojis; | |||
| } | |||
| module.exports = { | |||
| html2json: html2json, | |||
| emojisInit:emojisInit | |||
| }; | |||
| @@ -0,0 +1,192 @@ | |||
| /** | |||
| * | |||
| * htmlParser改造自: https://github.com/blowsie/Pure-JavaScript-HTML5-Parser | |||
| * | |||
| * author: Di (微信小程序开发工程师) | |||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||
| * 垂直微信小程序开发交流社区 | |||
| * | |||
| * github地址: https://github.com/icindy/wxParse | |||
| * | |||
| * for: 微信小程序富文本解析 | |||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||
| */ | |||
| // Regular Expressions for parsing tags and attributes | |||
| var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, | |||
| endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/, | |||
| attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; | |||
| // Empty Elements - HTML 5 | |||
| var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); | |||
| // Block Elements - HTML 5 | |||
| var block = makeMap("a,address,code,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); | |||
| // Inline Elements - HTML 5 | |||
| var inline = makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); | |||
| // Elements that you can, intentionally, leave open | |||
| // (and which close themselves) | |||
| var closeSelf = makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); | |||
| // Attributes that have their values filled in disabled="disabled" | |||
| var fillAttrs = makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); | |||
| // Special Elements (can contain anything) | |||
| var special = makeMap("wxxxcode-style,script,style,view,scroll-view,block"); | |||
| function HTMLParser(html, handler) { | |||
| var index, chars, match, stack = [], last = html; | |||
| stack.last = function () { | |||
| return this[this.length - 1]; | |||
| }; | |||
| while (html) { | |||
| chars = true; | |||
| // Make sure we're not in a script or style element | |||
| if (!stack.last() || !special[stack.last()]) { | |||
| // Comment | |||
| if (html.indexOf("<!--") == 0) { | |||
| index = html.indexOf("-->"); | |||
| if (index >= 0) { | |||
| if (handler.comment) | |||
| handler.comment(html.substring(4, index)); | |||
| html = html.substring(index + 3); | |||
| chars = false; | |||
| } | |||
| // end tag | |||
| } else if (html.indexOf("</") == 0) { | |||
| match = html.match(endTag); | |||
| if (match) { | |||
| html = html.substring(match[0].length); | |||
| match[0].replace(endTag, parseEndTag); | |||
| chars = false; | |||
| } | |||
| // start tag | |||
| } else if (html.indexOf("<") == 0) { | |||
| match = html.match(startTag); | |||
| if (match) { | |||
| html = html.substring(match[0].length); | |||
| match[0].replace(startTag, parseStartTag); | |||
| chars = false; | |||
| } | |||
| } | |||
| if (chars) { | |||
| index = html.indexOf("<"); | |||
| var text = '' | |||
| while (index === 0) { | |||
| text += "<"; | |||
| html = html.substring(1); | |||
| index = html.indexOf("<"); | |||
| } | |||
| text += index < 0 ? html : html.substring(0, index); | |||
| html = index < 0 ? "" : html.substring(index); | |||
| if (handler.chars) | |||
| handler.chars(text); | |||
| } | |||
| } else { | |||
| html = html.replace(new RegExp("([\\s\\S]*?)<\/" + stack.last() + "[^>]*>"), function (all, text) { | |||
| text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2"); | |||
| if (handler.chars) | |||
| handler.chars(text); | |||
| return ""; | |||
| }); | |||
| parseEndTag("", stack.last()); | |||
| } | |||
| if (html == last) | |||
| throw "Parse Error: " + html; | |||
| last = html; | |||
| } | |||
| // Clean up any remaining tags | |||
| parseEndTag(); | |||
| function parseStartTag(tag, tagName, rest, unary) { | |||
| tagName = tagName.toLowerCase(); | |||
| if (block[tagName]) { | |||
| while (stack.last() && inline[stack.last()]) { | |||
| parseEndTag("", stack.last()); | |||
| } | |||
| } | |||
| if (closeSelf[tagName] && stack.last() == tagName) { | |||
| parseEndTag("", tagName); | |||
| } | |||
| unary = empty[tagName] || !!unary; | |||
| if (!unary) | |||
| stack.push(tagName); | |||
| if (handler.start) { | |||
| var attrs = []; | |||
| rest.replace(attr, function (match, name) { | |||
| var value = arguments[2] ? arguments[2] : | |||
| arguments[3] ? arguments[3] : | |||
| arguments[4] ? arguments[4] : | |||
| fillAttrs[name] ? name : ""; | |||
| attrs.push({ | |||
| name: name, | |||
| value: value, | |||
| escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') //" | |||
| }); | |||
| }); | |||
| if (handler.start) { | |||
| handler.start(tagName, attrs, unary); | |||
| } | |||
| } | |||
| } | |||
| function parseEndTag(tag, tagName) { | |||
| // If no tag name is provided, clean shop | |||
| if (!tagName) | |||
| var pos = 0; | |||
| // Find the closest opened tag of the same type | |||
| else { | |||
| tagName = tagName.toLowerCase(); | |||
| for (var pos = stack.length - 1; pos >= 0; pos--) | |||
| if (stack[pos] == tagName) | |||
| break; | |||
| } | |||
| if (pos >= 0) { | |||
| // Close all the open elements, up the stack | |||
| for (var i = stack.length - 1; i >= pos; i--) | |||
| if (handler.end) | |||
| handler.end(stack[i]); | |||
| // Remove the open elements from the stack | |||
| stack.length = pos; | |||
| } | |||
| } | |||
| }; | |||
| function makeMap(str) { | |||
| var obj = {}, items = str.split(","); | |||
| for (var i = 0; i < items.length; i++) | |||
| obj[items[i]] = true; | |||
| return obj; | |||
| } | |||
| module.exports = HTMLParser; | |||
| @@ -0,0 +1,207 @@ | |||
| // HTML 支持的数学符号 | |||
| function strNumDiscode(str){ | |||
| str = str.replace(/∀/g, '∀'); | |||
| str = str.replace(/∂/g, '∂'); | |||
| str = str.replace(/&exists;/g, '∃'); | |||
| str = str.replace(/∅/g, '∅'); | |||
| str = str.replace(/∇/g, '∇'); | |||
| str = str.replace(/∈/g, '∈'); | |||
| str = str.replace(/∉/g, '∉'); | |||
| str = str.replace(/∋/g, '∋'); | |||
| str = str.replace(/∏/g, '∏'); | |||
| str = str.replace(/∑/g, '∑'); | |||
| str = str.replace(/−/g, '−'); | |||
| str = str.replace(/∗/g, '∗'); | |||
| str = str.replace(/√/g, '√'); | |||
| str = str.replace(/∝/g, '∝'); | |||
| str = str.replace(/∞/g, '∞'); | |||
| str = str.replace(/∠/g, '∠'); | |||
| str = str.replace(/∧/g, '∧'); | |||
| str = str.replace(/∨/g, '∨'); | |||
| str = str.replace(/∩/g, '∩'); | |||
| str = str.replace(/∩/g, '∪'); | |||
| str = str.replace(/∫/g, '∫'); | |||
| str = str.replace(/∴/g, '∴'); | |||
| str = str.replace(/∼/g, '∼'); | |||
| str = str.replace(/≅/g, '≅'); | |||
| str = str.replace(/≈/g, '≈'); | |||
| str = str.replace(/≠/g, '≠'); | |||
| str = str.replace(/≤/g, '≤'); | |||
| str = str.replace(/≥/g, '≥'); | |||
| str = str.replace(/⊂/g, '⊂'); | |||
| str = str.replace(/⊃/g, '⊃'); | |||
| str = str.replace(/⊄/g, '⊄'); | |||
| str = str.replace(/⊆/g, '⊆'); | |||
| str = str.replace(/⊇/g, '⊇'); | |||
| str = str.replace(/⊕/g, '⊕'); | |||
| str = str.replace(/⊗/g, '⊗'); | |||
| str = str.replace(/⊥/g, '⊥'); | |||
| str = str.replace(/⋅/g, '⋅'); | |||
| return str; | |||
| } | |||
| //HTML 支持的希腊字母 | |||
| function strGreeceDiscode(str){ | |||
| str = str.replace(/Α/g, 'Α'); | |||
| str = str.replace(/Β/g, 'Β'); | |||
| str = str.replace(/Γ/g, 'Γ'); | |||
| str = str.replace(/Δ/g, 'Δ'); | |||
| str = str.replace(/Ε/g, 'Ε'); | |||
| str = str.replace(/Ζ/g, 'Ζ'); | |||
| str = str.replace(/Η/g, 'Η'); | |||
| str = str.replace(/Θ/g, 'Θ'); | |||
| str = str.replace(/Ι/g, 'Ι'); | |||
| str = str.replace(/Κ/g, 'Κ'); | |||
| str = str.replace(/Λ/g, 'Λ'); | |||
| str = str.replace(/Μ/g, 'Μ'); | |||
| str = str.replace(/Ν/g, 'Ν'); | |||
| str = str.replace(/Ξ/g, 'Ν'); | |||
| str = str.replace(/Ο/g, 'Ο'); | |||
| str = str.replace(/Π/g, 'Π'); | |||
| str = str.replace(/Ρ/g, 'Ρ'); | |||
| str = str.replace(/Σ/g, 'Σ'); | |||
| str = str.replace(/Τ/g, 'Τ'); | |||
| str = str.replace(/Υ/g, 'Υ'); | |||
| str = str.replace(/Φ/g, 'Φ'); | |||
| str = str.replace(/Χ/g, 'Χ'); | |||
| str = str.replace(/Ψ/g, 'Ψ'); | |||
| str = str.replace(/Ω/g, 'Ω'); | |||
| str = str.replace(/α/g, 'α'); | |||
| str = str.replace(/β/g, 'β'); | |||
| str = str.replace(/γ/g, 'γ'); | |||
| str = str.replace(/δ/g, 'δ'); | |||
| str = str.replace(/ε/g, 'ε'); | |||
| str = str.replace(/ζ/g, 'ζ'); | |||
| str = str.replace(/η/g, 'η'); | |||
| str = str.replace(/θ/g, 'θ'); | |||
| str = str.replace(/ι/g, 'ι'); | |||
| str = str.replace(/κ/g, 'κ'); | |||
| str = str.replace(/λ/g, 'λ'); | |||
| str = str.replace(/μ/g, 'μ'); | |||
| str = str.replace(/ν/g, 'ν'); | |||
| str = str.replace(/ξ/g, 'ξ'); | |||
| str = str.replace(/ο/g, 'ο'); | |||
| str = str.replace(/π/g, 'π'); | |||
| str = str.replace(/ρ/g, 'ρ'); | |||
| str = str.replace(/ς/g, 'ς'); | |||
| str = str.replace(/σ/g, 'σ'); | |||
| str = str.replace(/τ/g, 'τ'); | |||
| str = str.replace(/υ/g, 'υ'); | |||
| str = str.replace(/φ/g, 'φ'); | |||
| str = str.replace(/χ/g, 'χ'); | |||
| str = str.replace(/ψ/g, 'ψ'); | |||
| str = str.replace(/ω/g, 'ω'); | |||
| str = str.replace(/ϑ/g, 'ϑ'); | |||
| str = str.replace(/ϒ/g, 'ϒ'); | |||
| str = str.replace(/ϖ/g, 'ϖ'); | |||
| str = str.replace(/·/g, '·'); | |||
| return str; | |||
| } | |||
| // | |||
| function strcharacterDiscode(str){ | |||
| // 加入常用解析 | |||
| str = str.replace(/ /g, ' '); | |||
| str = str.replace(/"/g, "'"); | |||
| str = str.replace(/&/g, '&'); | |||
| // str = str.replace(/</g, '‹'); | |||
| // str = str.replace(/>/g, '›'); | |||
| str = str.replace(/</g, '<'); | |||
| str = str.replace(/>/g, '>'); | |||
| str = str.replace(/•/g, '•'); | |||
| return str; | |||
| } | |||
| // HTML 支持的其他实体 | |||
| function strOtherDiscode(str){ | |||
| str = str.replace(/Œ/g, 'Œ'); | |||
| str = str.replace(/œ/g, 'œ'); | |||
| str = str.replace(/Š/g, 'Š'); | |||
| str = str.replace(/š/g, 'š'); | |||
| str = str.replace(/Ÿ/g, 'Ÿ'); | |||
| str = str.replace(/ƒ/g, 'ƒ'); | |||
| str = str.replace(/ˆ/g, 'ˆ'); | |||
| str = str.replace(/˜/g, '˜'); | |||
| str = str.replace(/ /g, ''); | |||
| str = str.replace(/ /g, ''); | |||
| str = str.replace(/ /g, ''); | |||
| str = str.replace(/‌/g, ''); | |||
| str = str.replace(/‍/g, ''); | |||
| str = str.replace(/‎/g, ''); | |||
| str = str.replace(/‏/g, ''); | |||
| str = str.replace(/–/g, '–'); | |||
| str = str.replace(/—/g, '—'); | |||
| str = str.replace(/‘/g, '‘'); | |||
| str = str.replace(/’/g, '’'); | |||
| str = str.replace(/‚/g, '‚'); | |||
| str = str.replace(/“/g, '“'); | |||
| str = str.replace(/”/g, '”'); | |||
| str = str.replace(/„/g, '„'); | |||
| str = str.replace(/†/g, '†'); | |||
| str = str.replace(/‡/g, '‡'); | |||
| str = str.replace(/•/g, '•'); | |||
| str = str.replace(/…/g, '…'); | |||
| str = str.replace(/‰/g, '‰'); | |||
| str = str.replace(/′/g, '′'); | |||
| str = str.replace(/″/g, '″'); | |||
| str = str.replace(/‹/g, '‹'); | |||
| str = str.replace(/›/g, '›'); | |||
| str = str.replace(/‾/g, '‾'); | |||
| str = str.replace(/€/g, '€'); | |||
| str = str.replace(/™/g, '™'); | |||
| str = str.replace(/←/g, '←'); | |||
| str = str.replace(/↑/g, '↑'); | |||
| str = str.replace(/→/g, '→'); | |||
| str = str.replace(/↓/g, '↓'); | |||
| str = str.replace(/↔/g, '↔'); | |||
| str = str.replace(/↵/g, '↵'); | |||
| str = str.replace(/⌈/g, '⌈'); | |||
| str = str.replace(/⌉/g, '⌉'); | |||
| str = str.replace(/⌊/g, '⌊'); | |||
| str = str.replace(/⌋/g, '⌋'); | |||
| str = str.replace(/◊/g, '◊'); | |||
| str = str.replace(/♠/g, '♠'); | |||
| str = str.replace(/♣/g, '♣'); | |||
| str = str.replace(/♥/g, '♥'); | |||
| str = str.replace(/♦/g, '♦'); | |||
| str = str.replace(/'/g, '\''); | |||
| return str; | |||
| } | |||
| function strMoreDiscode(str){ | |||
| str = str.replace(/\r\n/g,""); | |||
| str = str.replace(/\n/g,""); | |||
| str = str.replace(/code/g,"wxxxcode-style"); | |||
| return str; | |||
| } | |||
| function strDiscode(str){ | |||
| str = strNumDiscode(str); | |||
| str = strGreeceDiscode(str); | |||
| str = strcharacterDiscode(str); | |||
| str = strOtherDiscode(str); | |||
| str = strMoreDiscode(str); | |||
| return str; | |||
| } | |||
| function urlToHttpUrl(url,rep){ | |||
| var patt1 = new RegExp("^//"); | |||
| var result = patt1.test(url); | |||
| if(result){ | |||
| url = rep+":"+url; | |||
| } | |||
| return url; | |||
| } | |||
| module.exports = { | |||
| strDiscode:strDiscode, | |||
| urlToHttpUrl:urlToHttpUrl | |||
| } | |||
| @@ -0,0 +1,157 @@ | |||
| /** | |||
| * author: Di (微信小程序开发工程师) | |||
| * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com) | |||
| * 垂直微信小程序开发交流社区 | |||
| * | |||
| * github地址: https://github.com/icindy/wxParse | |||
| * | |||
| * for: 微信小程序富文本解析 | |||
| * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184 | |||
| */ | |||
| /** | |||
| * utils函数引入 | |||
| **/ | |||
| import showdown from './showdown.js'; | |||
| import HtmlToJson from './html2json.js'; | |||
| /** | |||
| * 配置及公有属性 | |||
| **/ | |||
| var realWindowWidth = 0; | |||
| var realWindowHeight = 0; | |||
| tt.getSystemInfo({ | |||
| success: function (res) { | |||
| realWindowWidth = res.windowWidth | |||
| realWindowHeight = res.windowHeight | |||
| } | |||
| }) | |||
| /** | |||
| * 主函数入口区 | |||
| **/ | |||
| function wxParse(bindName = 'wxParseData', type = 'html', data = '<div class="color:red;">数据不能为空</div>', target, imagePadding) { | |||
| var that = target; | |||
| var transData = {}; //存放转化后的数据 | |||
| if (type == 'html') { | |||
| transData = HtmlToJson.html2json(data, bindName); | |||
| } else if (type == 'md' || type == 'markdown') { | |||
| var converter = new showdown.Converter(); | |||
| var html = converter.makeHtml(data); | |||
| transData = HtmlToJson.html2json(html, bindName); | |||
| } | |||
| transData.view = {}; | |||
| transData.view.imagePadding = 0; | |||
| if (typeof (imagePadding) != 'undefined') { | |||
| transData.view.imagePadding = imagePadding | |||
| } | |||
| var bindData = {}; | |||
| bindData[bindName] = transData; | |||
| that.setData(bindData) | |||
| that.wxParseImgLoad = wxParseImgLoad; | |||
| that.wxParseImgTap = wxParseImgTap; | |||
| } | |||
| // 图片点击事件 | |||
| function wxParseImgTap(e) { | |||
| var that = this; | |||
| var nowImgUrl = e.target.dataset.src; | |||
| var tagFrom = e.target.dataset.from; | |||
| if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) { | |||
| tt.previewImage({ | |||
| current: nowImgUrl, // 当前显示图片的http链接 | |||
| urls: that.data[tagFrom].imageUrls // 需要预览的图片http链接列表 | |||
| }) | |||
| } | |||
| } | |||
| /** | |||
| * 图片视觉宽高计算函数区 | |||
| **/ | |||
| function wxParseImgLoad(e) { | |||
| var that = this; | |||
| var tagFrom = e.target.dataset.from; | |||
| var idx = e.target.dataset.idx; | |||
| if (typeof (tagFrom) != 'undefined' && tagFrom.length > 0) { | |||
| calMoreImageInfo(e, idx, that, tagFrom) | |||
| } | |||
| } | |||
| // 假循环获取计算图片视觉最佳宽高 | |||
| function calMoreImageInfo(e, idx, that, bindName) { | |||
| var temData = that.data[bindName]; | |||
| if (!temData || temData.images.length == 0) { | |||
| return; | |||
| } | |||
| var temImages = temData.images; | |||
| //因为无法获取view宽度 需要自定义padding进行计算,稍后处理 | |||
| var recal = wxAutoImageCal(e.detail.width, e.detail.height, that, bindName); | |||
| // temImages[idx].width = recal.imageWidth; | |||
| // temImages[idx].height = recal.imageheight; | |||
| // temData.images = temImages; | |||
| // var bindData = {}; | |||
| // bindData[bindName] = temData; | |||
| // that.setData(bindData); | |||
| var index = temImages[idx].index | |||
| var key = `${bindName}` | |||
| for (var i of index.split('.')) key += `.nodes[${i}]` | |||
| var keyW = key + '.width' | |||
| var keyH = key + '.height' | |||
| that.setData({ | |||
| [keyW]: recal.imageWidth, | |||
| [keyH]: recal.imageheight, | |||
| }) | |||
| } | |||
| // 计算视觉优先的图片宽高 | |||
| function wxAutoImageCal(originalWidth, originalHeight, that, bindName) { | |||
| //获取图片的原始长宽 | |||
| var windowWidth = 0, | |||
| windowHeight = 0; | |||
| var autoWidth = 0, | |||
| autoHeight = 0; | |||
| var results = {}; | |||
| var padding = that.data[bindName].view.imagePadding; | |||
| windowWidth = realWindowWidth - 2 * padding; | |||
| windowHeight = realWindowHeight; | |||
| //判断按照那种方式进行缩放 | |||
| // console.log("windowWidth" + windowWidth); | |||
| if (originalWidth > windowWidth) { //在图片width大于手机屏幕width时候 | |||
| autoWidth = windowWidth; | |||
| // console.log("autoWidth" + autoWidth); | |||
| autoHeight = (autoWidth * originalHeight) / originalWidth; | |||
| // console.log("autoHeight" + autoHeight); | |||
| results.imageWidth = autoWidth; | |||
| results.imageheight = autoHeight; | |||
| } else { //否则展示原来的数据 | |||
| results.imageWidth = originalWidth; | |||
| results.imageheight = originalHeight; | |||
| } | |||
| return results; | |||
| } | |||
| function wxParseTemArray(temArrayName, bindNameReg, total, that) { | |||
| var array = []; | |||
| var temData = that.data; | |||
| var obj = null; | |||
| for (var i = 0; i < total; i++) { | |||
| var simArr = temData[bindNameReg + i].nodes; | |||
| array.push(simArr); | |||
| } | |||
| temArrayName = temArrayName || 'wxParseTemArray'; | |||
| obj = JSON.parse('{"' + temArrayName + '":""}'); | |||
| obj[temArrayName] = array; | |||
| that.setData(obj); | |||
| } | |||
| /** | |||
| * 配置emojis | |||
| * | |||
| */ | |||
| function emojisInit(reg = '', baseSrc = "/wxParse/emojis/", emojis) { | |||
| HtmlToJson.emojisInit(reg, baseSrc, emojis); | |||
| } | |||
| module.exports = { | |||
| wxParse: wxParse, | |||
| wxParseTemArray: wxParseTemArray, | |||
| emojisInit: emojisInit | |||
| } | |||
| @@ -0,0 +1,965 @@ | |||
| <!--基础元素--> | |||
| <template name="wxParseVideo"> | |||
| <!--增加video标签支持,并循环添加--> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video> | |||
| </view> | |||
| </template> | |||
| <template name="wxParseImg"> | |||
| <image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" | |||
| data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" bindload="wxParseImgLoad" bindtap="wxParseImgTap" | |||
| mode="widthFix" style="width:{{item.width}}px;" /> | |||
| </template> | |||
| <template name="WxEmojiView"> | |||
| <view class="WxEmojiView wxParse-inline" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.textArray}}" tt:key=""> | |||
| <block class="{{item.text == '\\n' ? 'wxParse-hide':''}}" tt:if="{{item.node == 'text'}}">{{item.text}}</block> | |||
| <block tt:elif="{{item.node == 'element'}}"> | |||
| <image class="wxEmoji" src="{{item.baseSrc}}{{item.text}}" /> | |||
| </block> | |||
| </block> | |||
| </view> | |||
| </template> | |||
| <template name="WxParseBr"> | |||
| <text>\n</text> | |||
| </template> | |||
| <!--入口模版--> | |||
| <template name="wxParse"> | |||
| <block tt:for="{{wxParseData}}" tt:key=""> | |||
| <template is="wxParse0" tt:if="{{item.tag !='style'}}" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse0"> | |||
| <!--<template is="wxParse1" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'table'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse1" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse1"> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'&&item.tag !='style'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse2" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse2" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse2" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse2" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse2" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse2"> | |||
| <!--<template is="wxParse3" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse3" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse3" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse3" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse3" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse3" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'&&item.tag !='style'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse3"> | |||
| <!--<template is="wxParse4" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse4" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse4" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse4" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse4" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse4" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse4"> | |||
| <!--<template is="wxParse5" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse5" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse5" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse5" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse5" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse5" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse5"> | |||
| <!--<template is="wxParse6" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse6" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse6" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse6" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse6" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse6" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse6"> | |||
| <!--<template is="wxParse7" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse7" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse7" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse7" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse7" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse7" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse7"> | |||
| <!--<template is="wxParse8" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse8" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse8" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse8" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse8" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse8" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse8"> | |||
| <!--<template is="wxParse9" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse9" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse9" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse9" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse9" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse9" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse9"> | |||
| <!--<template is="wxParse10" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse10" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse10" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse10" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse10" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse10" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse10"> | |||
| <!--<template is="wxParse11" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse11" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse11" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse11" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse11" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse11" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| <!--循环模版--> | |||
| <template name="wxParse11"> | |||
| <!--<template is="wxParse12" data="{{item}}" />--> | |||
| <!--判断是否是标签节点--> | |||
| <block tt:if="{{item.node == 'element'}}"> | |||
| <block tt:if="{{item.tag == 'button'}}"> | |||
| <button type="default" size="mini"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse12" data="{{item}}" /> | |||
| </block> | |||
| </button> | |||
| </block> | |||
| <!--li类型--> | |||
| <block tt:elif="{{item.tag == 'li'}}"> | |||
| <view class="{{item.classStr}} wxParse-li" style="{{item.styleStr}}"> | |||
| <view class="{{item.classStr}} wxParse-li-inner"> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <view class="{{item.classStr}} wxParse-li-circle"></view> | |||
| </view> | |||
| <view class="{{item.classStr}} wxParse-li-text"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse12" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| </block> | |||
| <!--video类型--> | |||
| <block tt:elif="{{item.tag == 'video'}}"> | |||
| <template is="wxParseVideo" data="{{item}}" /> | |||
| </block> | |||
| <!--img类型--> | |||
| <block tt:elif="{{item.tag == 'img'}}"> | |||
| <template is="wxParseImg" data="{{item}}" /> | |||
| </block> | |||
| <!--a类型--> | |||
| <block tt:elif="{{item.tag == 'a'}}"> | |||
| <view bindtap="wxParseTagATap" class="wxParse-inline {{item.classStr}} wxParse-{{item.tag}}" | |||
| data-src="{{item.attr.href}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse12" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <block tt:elif="{{item.tag == 'br'}}"> | |||
| <template is="WxParseBr"></template> | |||
| </block> | |||
| <!--其他块级标签--> | |||
| <block tt:elif="{{item.tagType == 'block'}}"> | |||
| <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse12" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--内联标签--> | |||
| <view tt:else class="{{item.classStr}} wxParse-{{item.tag}} wxParse-{{item.tagType}}" style="{{item.styleStr}}"> | |||
| <block tt:for="{{item.nodes}}" tt:for-item="item" tt:key=""> | |||
| <template is="wxParse12" data="{{item}}" /> | |||
| </block> | |||
| </view> | |||
| </block> | |||
| <!--判断是否是文本节点--> | |||
| <block tt:elif="{{item.node == 'text'}}"> | |||
| <!--如果是,直接进行--> | |||
| <template is="WxEmojiView" data="{{item}}" /> | |||
| </block> | |||
| </template> | |||
| @@ -0,0 +1,293 @@ | |||
| .wxParse { | |||
| margin: 0 5px; | |||
| font-family: Helvetica, sans-serif; | |||
| font-size: 28rpx; | |||
| color: #666; | |||
| line-height: 1.8; | |||
| } | |||
| .content view { | |||
| word-break: break-all; | |||
| overflow: auto; | |||
| background: #FFF; | |||
| } | |||
| .wxParse-inline { | |||
| display: inline; | |||
| margin: 0; | |||
| padding: 0; | |||
| } | |||
| /*//标题 */ | |||
| .wxParse-div { | |||
| margin: 0; | |||
| padding: 0; | |||
| } | |||
| .wxParse-h1 { | |||
| font-size: 2em; | |||
| margin: .67em 0 | |||
| } | |||
| .wxParse-h2 { | |||
| font-size: 1.5em; | |||
| margin: .75em 0 | |||
| } | |||
| .wxParse-h3 { | |||
| font-size: 1.17em; | |||
| margin: .83em 0 | |||
| } | |||
| .wxParse-h4 { | |||
| margin: 1.12em 0 | |||
| } | |||
| .wxParse-h5 { | |||
| font-size: .83em; | |||
| margin: 1.5em 0 | |||
| } | |||
| .wxParse-h6 { | |||
| font-size: .75em; | |||
| margin: 1.67em 0 | |||
| } | |||
| .wxParse-h1 { | |||
| font-size: 18px; | |||
| font-weight: 400; | |||
| margin-bottom: .9em; | |||
| } | |||
| .wxParse-h2 { | |||
| font-size: 16px; | |||
| font-weight: 400; | |||
| margin-bottom: .34em; | |||
| } | |||
| .wxParse-h3 { | |||
| font-weight: 400; | |||
| font-size: 15px; | |||
| margin-bottom: .34em; | |||
| } | |||
| .wxParse-h4 { | |||
| font-weight: 400; | |||
| font-size: 14px; | |||
| margin-bottom: .24em; | |||
| } | |||
| .wxParse-h5 { | |||
| font-weight: 400; | |||
| font-size: 13px; | |||
| margin-bottom: .14em; | |||
| } | |||
| .wxParse-h6 { | |||
| font-weight: 400; | |||
| font-size: 12px; | |||
| margin-bottom: .04em; | |||
| } | |||
| .wxParse-h1, | |||
| .wxParse-h2, | |||
| .wxParse-h3, | |||
| .wxParse-h4, | |||
| .wxParse-h5, | |||
| .wxParse-h6, | |||
| .wxParse-b, | |||
| .wxParse-strong { | |||
| font-weight: bolder | |||
| } | |||
| .wxParse-i, | |||
| .wxParse-cite, | |||
| .wxParse-em, | |||
| .wxParse-var, | |||
| .wxParse-address { | |||
| font-style: italic | |||
| } | |||
| .wxParse-pre, | |||
| .wxParse-tt, | |||
| .wxParse-code, | |||
| .wxParse-kbd, | |||
| .wxParse-samp { | |||
| font-family: monospace | |||
| } | |||
| .wxParse-pre { | |||
| white-space: pre | |||
| } | |||
| .wxParse-big { | |||
| font-size: 1.17em | |||
| } | |||
| .wxParse-small, | |||
| .wxParse-sub, | |||
| .wxParse-sup { | |||
| font-size: .83em | |||
| } | |||
| .wxParse-sub { | |||
| vertical-align: sub | |||
| } | |||
| .wxParse-sup { | |||
| vertical-align: super | |||
| } | |||
| .wxParse-s, | |||
| .wxParse-strike, | |||
| .wxParse-del { | |||
| text-decoration: line-through | |||
| } | |||
| /*wxparse-自定义个性化的css样式*/ | |||
| /*增加video的css样式*/ | |||
| .wxParse-strong, | |||
| .wxParse-s { | |||
| display: inline | |||
| } | |||
| .wxParse-a { | |||
| color: deepskyblue; | |||
| word-break: break-all; | |||
| overflow: auto; | |||
| } | |||
| .wxParse-video { | |||
| text-align: center; | |||
| margin: 10px 0; | |||
| } | |||
| .wxParse-video-video { | |||
| width: 100%; | |||
| } | |||
| .wxParse-img { | |||
| /*background-color: #efefef;*/ | |||
| overflow: hidden; | |||
| } | |||
| .wxParse-blockquote { | |||
| margin: 0; | |||
| padding: 10px 0 10px 5px; | |||
| font-family: Courier, Calibri, "宋体"; | |||
| background: #f5f5f5; | |||
| border-left: 3px solid #dbdbdb; | |||
| } | |||
| .wxParse-code, | |||
| .wxParse-wxxxcode-style { | |||
| display: inline; | |||
| background: #f5f5f5; | |||
| } | |||
| .wxParse-ul { | |||
| margin: 20rpx 10rpx; | |||
| } | |||
| .wxParse-li, | |||
| .wxParse-li-inner { | |||
| display: flex; | |||
| align-items: baseline; | |||
| margin: 10rpx 0; | |||
| } | |||
| .wxParse-li-text { | |||
| align-items: center; | |||
| line-height: 20px; | |||
| } | |||
| .wxParse-li-circle { | |||
| display: inline-flex; | |||
| width: 5px; | |||
| height: 5px; | |||
| background-color: #333; | |||
| margin-right: 5px; | |||
| } | |||
| .wxParse-li-square { | |||
| display: inline-flex; | |||
| width: 10rpx; | |||
| height: 10rpx; | |||
| background-color: #333; | |||
| margin-right: 5px; | |||
| } | |||
| .wxParse-li-ring { | |||
| display: inline-flex; | |||
| width: 10rpx; | |||
| height: 10rpx; | |||
| border: 2rpx solid #333; | |||
| border-radius: 50%; | |||
| background-color: #fff; | |||
| margin-right: 5px; | |||
| } | |||
| /*.wxParse-table{ | |||
| width: 100%; | |||
| height: 400px; | |||
| } | |||
| .wxParse-thead,.wxParse-tfoot,.wxParse-tr{ | |||
| display: flex; | |||
| flex-direction: row; | |||
| } | |||
| .wxParse-th,.wxParse-td{ | |||
| display: flex; | |||
| width: 580px; | |||
| overflow: auto; | |||
| }*/ | |||
| .wxParse-u { | |||
| text-decoration: underline; | |||
| } | |||
| .wxParse-hide { | |||
| display: none; | |||
| } | |||
| .WxEmojiView { | |||
| align-items: center; | |||
| } | |||
| .wxEmoji { | |||
| width: 16px; | |||
| height: 16px; | |||
| } | |||
| .wxParse-tr { | |||
| display: flex; | |||
| border-right: 1px solid #e0e0e0; | |||
| border-bottom: 1px solid #e0e0e0; | |||
| border-top: 1px solid #e0e0e0; | |||
| } | |||
| .wxParse-th, | |||
| .wxParse-td { | |||
| flex: 1; | |||
| padding: 5px; | |||
| font-size: 28rpx; | |||
| border-left: 1px solid #e0e0e0; | |||
| word-break: break-all; | |||
| } | |||
| .wxParse-td:last { | |||
| border-top: 1px solid #e0e0e0; | |||
| } | |||
| .wxParse-th { | |||
| background: #f0f0f0; | |||
| border-top: 1px solid #e0e0e0; | |||
| } | |||
| .wxParse-del { | |||
| display: inline; | |||
| } | |||
| .wxParse-figure { | |||
| overflow: hidden; | |||
| } | |||
| @@ -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({ | |||
| @@ -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: '提示', | |||
| @@ -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: '提示', | |||
| @@ -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') {} | |||
| } | |||
| }; | |||
| @@ -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; | |||
| } | |||
| @@ -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 | |||
| @@ -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) | |||
| }, | |||
| @@ -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> | |||
| @@ -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,14 @@ 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] || ""; | |||
| } else if (options.type == 'scanInAu') { | |||
| console.log(options, 'scanInAu'); | |||
| tt.setStorageSync('mallTenantId', this.data.newArr[2] || ""); | |||
| } | |||
| } | |||
| } | |||
| @@ -102,7 +109,7 @@ Page({ | |||
| if (options.couponChannelId || options.orderId || options.id) { | |||
| that.userStatus(options); | |||
| } else { | |||
| that.userStatus(); | |||
| that.userStatus(options); | |||
| } | |||
| } else { | |||
| // 由于 token 是网络请求,可能会在 Page.onLoad 之后才返回 | |||
| @@ -113,7 +120,7 @@ Page({ | |||
| if (options.couponChannelId || options.orderId || options.id) { | |||
| that.userStatus(options); | |||
| } else { | |||
| that.userStatus(); | |||
| that.userStatus(options); | |||
| } | |||
| } | |||
| } | |||
| @@ -122,12 +129,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 +157,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'){//问卷调查 | |||
| tt.redirectTo({ | |||
| url: `/pages/questionnaire/questionnaireLsit/questionnaireLsit`, | |||
| }) | |||
| } | |||
| // 答题问卷 | |||
| else if (options && options.id && app.globalData.type == 'wj') { | |||
| // 参与砍价 | |||
| else if (options && options.orderId) { | |||
| tt.redirectTo({ | |||
| url: `/pages/questionnaire/questionnaire?id=${options.id}`, | |||
| url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${options.orderId}&from=${"discount"}`, | |||
| }) | |||
| } | |||
| // 报名活动页面 | |||
| else if (options && options.id && app.globalData.type == 'ra') { | |||
| tt.redirectTo({ | |||
| url: `/pages/radetail/index?id=${options.id}`, | |||
| }) | |||
| } else if (app.globalData.type == 'uc') { | |||
| // 我的 | |||
| else if (app.globalData.type == 'uc') { | |||
| tt.navigateTo({ | |||
| url: '/index/user' | |||
| }); | |||
| @@ -470,12 +307,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 +378,7 @@ Page({ | |||
| } | |||
| // 我的拼团 | |||
| else if (app.globalData.type == 'ms') { | |||
| // 我的拼团 | |||
| tt.redirectTo({ | |||
| url: '/pages/spellGroup/spellGroup?from=myhtml' | |||
| }) | |||
| @@ -558,29 +390,243 @@ 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 if (app.globalData.type == 'scanInAu') { | |||
| console.log('scanInAu!!!!!!!'); | |||
| tt.navigateTo({ | |||
| url: `/pages/mallInfo/mallInfo` | |||
| }) | |||
| } 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 if (app.globalData.type == 'scanInAu') { | |||
| tt.navigateTo({ | |||
| url: `/pages/mallInfo/mallInfo` | |||
| }) | |||
| } 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 +644,7 @@ Page({ | |||
| title: '提示', | |||
| content: err.message, | |||
| showCancel: false, | |||
| success: function(res) { | |||
| success: function (res) { | |||
| // 如果游戏下架或者找不到,重启首页 | |||
| if (res.confirm) { | |||
| tt.reLaunch({ | |||
| @@ -11,44 +11,69 @@ Page({ | |||
| */ | |||
| data: { | |||
| navigationBarHeight, | |||
| weekName:[], | |||
| times:[], | |||
| dateArr:[ | |||
| { name: "星期一", value: "0" }, | |||
| { name: "星期二", value: "1" }, | |||
| { name: "星期三", value: "2" }, | |||
| { name: "星期四", value: "3" }, | |||
| { name: "星期五", value: "4" }, | |||
| { name: "星期六", value: "5" }, | |||
| { name: "星期天", value: "6" } | |||
| weekName: [], | |||
| times: [], | |||
| dateArr: [{ | |||
| name: "星期一", | |||
| value: "0" | |||
| }, | |||
| { | |||
| name: "星期二", | |||
| value: "1" | |||
| }, | |||
| { | |||
| name: "星期三", | |||
| value: "2" | |||
| }, | |||
| { | |||
| name: "星期四", | |||
| value: "3" | |||
| }, | |||
| { | |||
| name: "星期五", | |||
| value: "4" | |||
| }, | |||
| { | |||
| name: "星期六", | |||
| value: "5" | |||
| }, | |||
| { | |||
| name: "星期天", | |||
| value: "6" | |||
| } | |||
| ], | |||
| mallTenantId: "" | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面显示 | |||
| */ | |||
| onShow: function () { | |||
| onShow: function (options) { | |||
| let that = this; | |||
| const mallTenantId = tt.getStorageSync('mallTenantId'); | |||
| console.log("渲染开始") | |||
| Http.get({ | |||
| url: config.api.getMallInfo, | |||
| }) | |||
| url: config.api.getMallInfo, | |||
| data: { | |||
| mallTenantId: mallTenantId | |||
| } | |||
| }) | |||
| .then(res => { | |||
| if (res.data.businessHours){ | |||
| if (res.data.businessHours) { | |||
| let businessHours = JSON.parse(res.data.businessHours) | |||
| businessHours.map((item, index) => { | |||
| item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name, that.data.dateArr.filter(e => e.value == item.week[1])[0].name].toString().replace(/\,/g, ' -- '), | |||
| item.time = [util.convertUTCTimeToLocalTime(item.time[0]), util.convertUTCTimeToLocalTime(item.time[1])].toString().replace(/\,/g, ' -') | |||
| }) | |||
| console.log(businessHours, 222) | |||
| that.setData({ | |||
| name: res.data.name, | |||
| servicePhone: res.data.servicePhone, | |||
| img: res.data.img, | |||
| introduction: res.data.introduction, | |||
| parkPlaceNumber: res.data.parkPlaceNumber, | |||
| businessHoursH: businessHours, | |||
| }) | |||
| } | |||
| businessHours.map((item, index) => { | |||
| item.weekName = [that.data.dateArr.filter(e => e.value == item.week[0])[0].name, that.data.dateArr.filter(e => e.value == item.week[1])[0].name].toString().replace(/\,/g, ' -- '), | |||
| item.time = [util.convertUTCTimeToLocalTime(item.time[0]), util.convertUTCTimeToLocalTime(item.time[1])].toString().replace(/\,/g, ' -') | |||
| }) | |||
| console.log(businessHours, 222) | |||
| that.setData({ | |||
| name: res.data.name, | |||
| servicePhone: res.data.servicePhone, | |||
| img: res.data.img, | |||
| introduction: res.data.introduction, | |||
| parkPlaceNumber: res.data.parkPlaceNumber, | |||
| businessHoursH: businessHours, | |||
| }) | |||
| } | |||
| }) | |||
| .catch(err => { | |||
| tt.showModal({ | |||
| @@ -5,6 +5,8 @@ let Http = require("../../../utils/HttpBasics"); | |||
| let app = getApp(); | |||
| const imgurl = require("../../../utils/imgurl"); | |||
| const QR = require("../../../utils/memberqrcode.js"); | |||
| var ttParse = require('../../freeBannerDetail/ttParse/wxParse.js'); | |||
| Page({ | |||
| /** | |||
| * 页面的初始数据 | |||
| @@ -12,12 +14,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, | |||
| @@ -34,6 +37,7 @@ Page({ | |||
| wm02Url: imgurl.wm02.url, | |||
| wm03Url: imgurl.wm03.url, | |||
| wm04Url: imgurl.wm04.url, | |||
| wm05Url: imgurl.wm05.url, | |||
| showModalStatus: false, | |||
| flag: 0, | |||
| order: null, | |||
| @@ -50,24 +54,73 @@ Page({ | |||
| cardIf: false, | |||
| contentType: 0, | |||
| orderFlag: false, //判断是不是线上配送 | |||
| tenantId: '', | |||
| mallList: [], | |||
| imId: "", | |||
| orderStatus: 1, | |||
| tenantId: "", | |||
| IMorderId: "", | |||
| outOrderId: "", | |||
| outRefundOrderId: "", | |||
| canIUseRefund: false, | |||
| isAppointment: false, | |||
| appointStart: "", | |||
| appointEnd: "", | |||
| appointmentId: "", | |||
| appointmentStatus: "", | |||
| use_num_per_consume: "", | |||
| }, | |||
| imCallback(e) { | |||
| console.log("跳转IM客服成功", e); | |||
| }, | |||
| onimError(e) { | |||
| console.log("拉起IM客服失败", e.detail); | |||
| }, | |||
| 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, 'handleRefund'); | |||
| } else { | |||
| const { errMsg } = result; | |||
| const { | |||
| errMsg | |||
| } = result; | |||
| console.log(errMsg); | |||
| } | |||
| }, | |||
| applyRefund(event) { | |||
| const { orderId } = event.detail; | |||
| const extra = { orderId }; // 开发者需要透传的参数,可自定义内容 | |||
| console.log('applyRefund'); | |||
| const { | |||
| orderId | |||
| } = event.detail; | |||
| const extra = { | |||
| tenantId: this.data.tenantId | |||
| }; // 开发者需要透传的参数,可自定义内容 | |||
| return new Promise(resolve => { | |||
| console.log(extra, 'extra'); | |||
| console.log(this.data.outOrderId, 'outOrderId'); | |||
| resolve(extra); | |||
| }); | |||
| }, | |||
| handleError(event) { | |||
| const { | |||
| errMsg, | |||
| errNo | |||
| } = event.detail; | |||
| console.log(event, 'err'); | |||
| }, | |||
| showId() { | |||
| let this_ = this; | |||
| if (!this_.data.showIdFalg) { | |||
| @@ -130,9 +183,176 @@ Page({ | |||
| }) | |||
| }, | |||
| goDetail() { | |||
| goAppointment(e, orderIdin) { | |||
| const that = this | |||
| const orderId = e ? e.currentTarget.dataset.id : orderIdin | |||
| const id = this.data.appointmentId | |||
| const merOrderId = this.data.orderId | |||
| const startTime = that.data.order.validStartDATE | |||
| const endTime = that.data.order.validEndDate | |||
| console.log(startTime, endTime); | |||
| tt.navigateTo({ | |||
| url: `/pages2/appointment/appointment?id=${id}&orderId=${orderId}&merOrderId=${merOrderId}&startTime=${startTime}&endTime=${endTime}`, | |||
| }); | |||
| }, | |||
| getUserReservation(couponOrderId) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getUserReservation, | |||
| data: { | |||
| couponOrderId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getUserReservation'); | |||
| if (res.data) { | |||
| const appointStart = util.timestampToTime(res.data.startDate, 'YYYY-MM-DD hh:mm') | |||
| const appointEnd = util.timestampToTime(res.data.endDate, 'hh:mm') | |||
| console.log(appointStart, appointEnd); | |||
| const appointmentId = res.data.id | |||
| const appointmentStatus = res.data.status | |||
| that.setData({ | |||
| appointStart, | |||
| appointEnd, | |||
| appointmentId, | |||
| appointmentStatus, | |||
| isAppointment: true | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| console.log(err, 'getUserReservation'); | |||
| }) | |||
| }, | |||
| getOrderStatus(orderId) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getRefundStatus, | |||
| data: { | |||
| orderId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'res'); | |||
| const orderStatus = res.data.orderStatus | |||
| const outOrderId = res.data.outOrderId | |||
| const refundOrderStatus = res.data.refundOrderStatus | |||
| const outRefundOrderId = res.data.outRefundOrderId | |||
| let status = '' | |||
| if (orderStatus == 1) { // 申请退款 | |||
| status = 1 | |||
| } else if (orderStatus == 3 || orderStatus == 4 || orderStatus == 5) { | |||
| if (refundOrderStatus == 1 || refundOrderStatus == 11) { // 退款中 | |||
| status = 2 | |||
| } else if (refundOrderStatus == 3) { //退款成功 | |||
| status = 3 | |||
| } else if (refundOrderStatus == 4) { //退款失败 | |||
| status = 4 | |||
| } else { // 退款处理中 | |||
| status = 0 | |||
| } | |||
| that.setData({ | |||
| outRefundOrderId: outRefundOrderId | |||
| }) | |||
| } else if (orderStatus == 2) { | |||
| status = 'orderCancel' | |||
| } else { | |||
| status = 'noRefund' | |||
| } | |||
| that.setData({ | |||
| orderStatus: status, | |||
| outOrderId: outOrderId | |||
| }) | |||
| }).catch(err => { | |||
| console.log(err, 'err'); | |||
| }) | |||
| }, | |||
| getIm() { //获取im客服id | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getIm, | |||
| data: { | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getIm'); | |||
| const imId = res.data.imId ? res.data.imId : "" | |||
| that.setData({ | |||
| imId: imId | |||
| }) | |||
| }).catch(err => { | |||
| console.log(err, 'err'); | |||
| }) | |||
| }, | |||
| getCouponMerchant() { //获取适用门店 | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.orderDetail, | |||
| data: { | |||
| orderId: this.data.orderId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| const couponChannelId = res.data.orders[0].couponChannelId | |||
| const orderID = res.data.orders[0].id | |||
| const cOrderID = res.data.orders[0].couponOrderId | |||
| that.getOrderStatus(orderID) | |||
| that.getUserReservation(cOrderID) | |||
| that.getIm() | |||
| const extParam = res.data.extParam || null | |||
| if (extParam) { | |||
| const obj = JSON.parse(extParam) | |||
| that.setData({ | |||
| IMorderId: obj.order_id, | |||
| tenantId: res.data.tenantId, | |||
| }) | |||
| } | |||
| 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(e) { | |||
| if (e.target.id == "payBtn") return | |||
| 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 +361,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 +407,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,16 +430,30 @@ Page({ | |||
| Http.get({ | |||
| url: url, | |||
| data: { | |||
| orderId: this.data.orderId | |||
| orderId: this.data.orderId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| tt.hideLoading(); | |||
| var createDate = util.formatTime(res.data.orders[0].createDate, "yyyy-MM-dd"); | |||
| if (res.data.tenantId) { | |||
| that.setData({ | |||
| tenantId: res.data.tenantId | |||
| }) | |||
| } | |||
| var createDate = util.timestampToTime(res.data.orders[0].createDate, "YYYY-MM-DD"); | |||
| let tempData = res.data.orders[0] | |||
| tempData.deliveryInfo = tempData.deliveryInfo ? JSON.parse(tempData.deliveryInfo) : "" | |||
| tempData.itemGroup = tempData.itemGroup ? JSON.parse(tempData.itemGroup) : "" | |||
| tempData.validStartDate = util.formatTime(tempData.validStartDate, "yyyy-MM-dd") | |||
| tempData.validEndDate = util.formatTime(tempData.validEndDate, "yyyy-MM-dd") | |||
| tempData.soldStartTime = util.timestampToTime(tempData.soldStartTime, "YYYY-MM-DD") || null, | |||
| tempData.soldEndTime = util.timestampToTime(tempData.soldEndTime, "YYYY-MM-DD") || null, | |||
| tempData.validStartDATE = tempData.validStartDate | |||
| tempData.validEndDATE = tempData.validEndDate | |||
| tempData.validStartDate = util.timestampToTime(tempData.validStartDate, "YYYY-MM-DD") | |||
| tempData.validEndDate = util.timestampToTime(tempData.validEndDate, "YYYY-MM-DD") | |||
| tempData.couponOrderIdS = tempData.couponOrderId ? tempData.couponOrderId.slice(0, 4) + `******` + tempData.couponOrderId.slice(14) : '' | |||
| if (tempData.productAttrs && tempData.skuAttrs) { | |||
| @@ -234,15 +469,23 @@ Page({ | |||
| if (tempAppoinObj.need_appointment) { | |||
| let subscribeSing = ""; | |||
| if (tempAppoinObj.ahead_time_type == 1) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_day_num}天预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 2) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_hour_num}小时预约` | |||
| } else if (tempAppoinObj.ahead_time_type == 3) { | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟致电商家预约` | |||
| subscribeSing = `需提前${tempAppoinObj.ahead_minute_num}分钟预约` | |||
| } | |||
| tempData.subscribeSing = subscribeSing | |||
| } | |||
| } | |||
| if (item.key == "limit_use_rule") { | |||
| if (item.data != '') { | |||
| let tempAppoinObj = JSON.parse(item.data) | |||
| that.setData({ | |||
| use_num_per_consume: tempAppoinObj.use_num_per_consume || "" | |||
| }) | |||
| } | |||
| } | |||
| if (item.key == "Notification") { | |||
| @@ -268,7 +511,7 @@ Page({ | |||
| } | |||
| if (item.key == 'Description') { | |||
| if (item.key == 'Description' && item.isRequired) { | |||
| tempData.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| @@ -286,6 +529,48 @@ Page({ | |||
| } | |||
| if (tempData.type == 69 && tempData.couponOrderStatus == 0) { | |||
| // Http.get({ | |||
| // url: config.api.orderDetail, | |||
| // data: { | |||
| // orderId: that.data.orderId, | |||
| // mallTenantId: that.data.mallTenantId || '' | |||
| // } | |||
| // }).then(res => { | |||
| // const cOrderID = res.data.orders[0].couponOrderId | |||
| // that.getUserReservation(cOrderID) | |||
| // }).catch(err => { | |||
| // }) | |||
| setTimeout(() => { | |||
| const isAppointment = that.data.isAppointment | |||
| const appointmentStatus = that.data.appointmentStatus | |||
| const Appointment = tt.getStorageSync('appointment'); | |||
| if (Appointment && (!isAppointment || appointmentStatus == '-1')) { | |||
| tt.showModal({ | |||
| title: "提示", | |||
| content: "是否立即填写预约信息?", | |||
| showCancel: true, | |||
| confirmText: "现在预约", | |||
| confirmColor: "#deb472", | |||
| cancelText: "稍后预约", | |||
| success(res) { | |||
| if (res.confirm) { | |||
| tt.setStorageSync('appointment', false); | |||
| that.goAppointment(false, tempData.couponOrderId) | |||
| } | |||
| if (res.cancel) { | |||
| } | |||
| } | |||
| }); | |||
| } | |||
| }, 1000); | |||
| } | |||
| that.setData({ | |||
| outOrderNo: res.data.id, | |||
| @@ -293,38 +578,47 @@ Page({ | |||
| showPage: true, | |||
| 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.contentType != undefined && tempData.contentType == 1) { | |||
| //获取图文展示详情html | |||
| that.setData({ | |||
| contentType: tempData.contentType ? tempData.contentType : 0, | |||
| }) | |||
| that.getHtml(tempData.couponChannelId); | |||
| } | |||
| if (tempData.couponOrderId) { //0未付款 1已支付 2已取消 3退款中 4已退款 | |||
| that.setRq() | |||
| // that.upStatus() | |||
| 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, | |||
| @@ -333,14 +627,43 @@ Page({ | |||
| mask: false | |||
| }); | |||
| }) | |||
| } else { | |||
| Http.get({ | |||
| url: config.api.getStatus, | |||
| data: { | |||
| couponOrderId: tempData.couponOrderId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getStatus'); | |||
| 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() | |||
| that.setData({ | |||
| mystatus: res.data.CouponOrderStatus | |||
| }); | |||
| } | |||
| }) | |||
| .catch(err => { | |||
| console.log(err); | |||
| }) | |||
| } | |||
| }, 2000); | |||
| that.setData({ | |||
| 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 +715,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 +763,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) { | |||
| //倒计时为零直接显示券码 | |||
| @@ -489,6 +815,30 @@ Page({ | |||
| }) | |||
| }, | |||
| getHtml(couponChannelId) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.couponHtmlDetail, | |||
| data: { | |||
| couponChannelId: couponChannelId, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res) | |||
| if (res.code == 200 && res.data.html) { | |||
| const curHtml = decodeURI(res.data.html) | |||
| this.setData({ | |||
| curHtml, | |||
| }) | |||
| var temp = ttParse.wxParse('article', 'html', curHtml, that, 5); | |||
| app.globalData.curHtml = this.data.curHtml; | |||
| } | |||
| }) | |||
| }, | |||
| goPaySnapshoot(e) { | |||
| let id = e.currentTarget.dataset.id; | |||
| tt.navigateTo({ | |||
| @@ -501,6 +851,7 @@ Page({ | |||
| }, | |||
| }); | |||
| }, | |||
| powerDrawer: function (e) { | |||
| let that = this; | |||
| console.log(e) | |||
| @@ -541,20 +892,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 +914,9 @@ Page({ | |||
| let _this = this | |||
| tt.rateAwemeOrder({ | |||
| orderId: _this.data.payOrderNo, | |||
| success({ result }) { | |||
| success({ | |||
| result | |||
| }) { | |||
| console.log(result); | |||
| if (result) { | |||
| tt.navigateBack({ | |||
| @@ -591,12 +944,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], | |||
| @@ -617,8 +973,23 @@ Page({ | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| onLoad: function (options) { | |||
| this.getSeUrl() | |||
| onLoad: function (option) { | |||
| console.log(option, 'option'); | |||
| let options = null | |||
| if (option.params) { | |||
| options = JSON.parse(option.params) | |||
| } else { | |||
| options = option | |||
| } | |||
| // this.getSeUrl() | |||
| if (options.mallTenantId) { | |||
| this.setData({ | |||
| mallTenantId: options.mallTenantId, | |||
| }) | |||
| } | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType | |||
| }) | |||
| @@ -628,10 +999,9 @@ Page({ | |||
| // } | |||
| that.setData({ | |||
| orderId: options.orderId, | |||
| }); | |||
| tt.hideShareMenu() | |||
| if (options.cardIf) {//转赠 展示不需 | |||
| if (options.cardIf) { //转赠 展示不需 | |||
| that.setData({ | |||
| cardIf: true | |||
| }) | |||
| @@ -640,8 +1010,7 @@ Page({ | |||
| title: "加载中" | |||
| }); | |||
| this.getCouponMerchant() //获取可用商户 | |||
| }, | |||
| onShow: function () { | |||
| let that = this; | |||
| @@ -649,8 +1018,15 @@ Page({ | |||
| showButton: false | |||
| }) | |||
| that.updetail() | |||
| this.getCouponMerchant() //获取可用商户 | |||
| if (tt.canIUse("microapp-trade-plugin")) { | |||
| that.setData({ | |||
| canIUseRefund: true | |||
| }) | |||
| console.log(that.data.canIUseRefund, 'canIUseRefund'); | |||
| } | |||
| }, | |||
| getSeUrl() {//获取客服链接 | |||
| getSeUrl() { //获取客服链接 | |||
| const openId = tt.getStorageSync('openId'); | |||
| Http.post({ | |||
| url: config.api.getServiceUrl, | |||
| @@ -686,16 +1062,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 +1095,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 +1103,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 +1119,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 +1184,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 +1228,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 +1371,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 +1402,16 @@ Page({ | |||
| tt.hideLoading(); | |||
| }, 1600); | |||
| setTimeout(() => { | |||
| console.log('Here1'); | |||
| tt.setStorageSync('appointment', true); | |||
| 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 +1419,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 +1444,4 @@ Page({ | |||
| clearInterval(that.data.setInter); | |||
| clearInterval(that.data.templTiem); | |||
| }, | |||
| }); | |||
| }); | |||
| @@ -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" | |||
| } | |||
| } | |||
| @@ -1,189 +1,332 @@ | |||
| <!-- <navbar home back text="订单详情"></navbar> | |||
| <view style="height:{{navigationBarHeight}} "></view> --> | |||
| <view class='order' tt:if="{{showPage}}"> | |||
| <view tt:if="{{order.orderStatus==1}}" class='tips'> | |||
| <image class='success' src='{{succUrl}}' mode='widthFix'></image> | |||
| <view tt:if="{{order.salePrice/100==0}}" class='msg'> | |||
| <text>交易成功</text> | |||
| <!-- <text>请尽快到门店使用,有效期至{{}}</text> --> | |||
| </view> | |||
| <view tt:if="{{order.salePrice/100!=0}}" class='msg'> | |||
| <text>付款成功</text> | |||
| <!-- <text>请尽快到门店使用,有效期至{{}}</text> --> | |||
| </view> | |||
| <view tt:if="{{IMorderId && imId}}" class="serviceBOX"> | |||
| <button class="serviceBox2" open-type="im" data-im-id="{{ imId }}" data-im-type="order" | |||
| data-order-id="{{ IMorderId }}" bindim="imCallback" binderror="onimError"> | |||
| <view class="fuwuLogoBox f"> | |||
| <image class="itemLogo" src="../../../assets/images/service1.png" /> | |||
| </view> | |||
| </button> | |||
| </view> | |||
| </view> | |||
| <view class='section'> | |||
| <view class='sectionTit'> | |||
| <text>{{order.title}}</text> | |||
| <view tt:if="{{order.orderStatus==1}}" class='tips'> | |||
| <image class='success' src='{{succUrl}}' mode='widthFix'></image> | |||
| <view tt:if="{{order.salePrice/100==0}}" class='msg'> | |||
| <text>交易成功</text> | |||
| <!-- <text>请尽快到门店使用,有效期至{{}}</text> --> | |||
| </view> | |||
| <view tt:if="{{order.salePrice/100!=0}}" class='msg'> | |||
| <text>付款成功</text> | |||
| <!-- <text>请尽快到门店使用,有效期至{{}}</text> --> | |||
| </view> | |||
| </view> | |||
| <view class='section'> | |||
| <view class='sectionTit'> | |||
| <text>{{order.title}}</text> | |||
| </view> | |||
| <!-- --> | |||
| <view class='detail_msg' bindtap="goDetail"> | |||
| <view class='logo'> | |||
| <image mode='aspectFill' src='{{order.coverImg}}'></image> | |||
| </view> | |||
| <!-- --> | |||
| <view class='detail_msg' bindtap="goDetail"> | |||
| <view class='logo'> | |||
| <image mode='aspectFill' src='{{order.coverImg}}'></image> | |||
| <view class='info'> | |||
| <view class="salePriceStr "> | |||
| <view class='rmb'>¥</view> | |||
| <view class="pri01">{{(order.payment)/100}}</view> | |||
| <view class="throgh">{{(order.price)/100}}</view> | |||
| </view> | |||
| <view class="subTitle"> | |||
| <text>{{order.subTitle}}</text> | |||
| </view> | |||
| <view class="xidanTiem"> | |||
| <text>下单时间:</text>{{createDate}} | |||
| </view> | |||
| <view class='info'> | |||
| <view class="salePriceStr "> | |||
| <view class='rmb'>¥</view> | |||
| <view class="pri01">{{(order.payment)/100}}</view> | |||
| <view class="throgh">{{(order.price)/100}}</view> | |||
| </view> | |||
| <view class="subTitle"> | |||
| <text>{{order.subTitle}}</text> | |||
| </view> | |||
| <view class="xidanTiem"> | |||
| <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> | |||
| <!-- <pay-button | |||
| class="goRefund" | |||
| order-status="{{1}}" | |||
| order-id="ot7122287526357895463" | |||
| bind:refund="handleRefund" | |||
| bind:applyrefund="applyRefund" | |||
| /> | |||
| </view> --> | |||
| </view> | |||
| </view> | |||
| <image class="infoArrow" src="{{chevronUrl}}" 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 | |||
| tt:if="{{orderStatus != 'noRefund' && orderStatus != 'orderCancel' && (couponOrderStatus == 0 || couponOrderStatus == 3) }}"> | |||
| <pay-button tt:if="{{orderStatus}}" id='payBtn' class="goRefundPayBtn" order-status="{{orderStatus}}" | |||
| order-id="{{outOrderId}}" refund-id="{{outRefundOrderId}}" bind:refund="handleRefund" | |||
| bind:applyrefund="applyRefund" bind:error="handleError" /> | |||
| <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 id='payBtn' tt:if="{{!orderStatus}}" class="goRefund"> | |||
| 退款处理中 | |||
| </view> | |||
| </view> | |||
| <view class="coedTiem" tt:if="{{!showhieRq&&expiredSeconds>1}}">二维码在 | |||
| <text style="color:red">{{expiredSeconds}}s</text> | |||
| 后失效 | |||
| <view tt:if="{{orderStatus == 'orderCancel'}}"> | |||
| <view id='payBtn' class="goRefund"> | |||
| 交易关闭 | |||
| </view> | |||
| </view> | |||
| <!-- <view class="barnum buy"><text>兑换码:</text>{{code}}</view> --> | |||
| </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> --> | |||
| </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 && orderStatus != 2}}" src="{{wm03Url}}" mode='widthFix'></image> | |||
| <image tt:if="{{order.couponOrderStatus==3 && orderStatus == 2}}" src="{{wm05Url}}" 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> | |||
| <!-- <view class="barnum buy"><text>兑换码:</text>{{code}}</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.type == 69 && order.couponOrderStatus == 0}}" class='dhCode' data-id="{{order.couponOrderId}}" | |||
| bindtap="goAppointment"> | |||
| <view style="width:86%;clear: both;"> | |||
| <text class="fl">预约时间:</text> | |||
| <text tt:if="{{ !isAppointment }}" class="fr" style="color: #d4a971;">点击预约</text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 0 }}" class="fr" style="color: #d4a971">{{appointStart }}{{ | |||
| ' - ' }}{{ appointEnd}}</text> | |||
| <text | |||
| tt:if="{{ isAppointment && ( appointmentStatus == 1 || appointmentStatus == 2 || appointmentStatus == 3 ) }}" | |||
| class="fr" style="color: #d4a971;">预约已取消 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 4 }}" class="fr" style="color: #d4a971;">预约派单中 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 5 }}" class="fr" style="color: #d4a971;">预约已派单 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 6 }}" class="fr" style="color: #d4a971;">预约派单中 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 7 }}" class="fr" style="color: #d4a971;">预约派单中 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 8 }}" class="fr" style="color: #d4a971;">服务已完成 | |||
| </text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == 9 }}" class="fr" style="color: #d4a971;">已评价</text> | |||
| <text tt:if="{{ isAppointment && appointmentStatus == '-1' }}" class="fr" style="color: #d4a971;">完善预约信息</text> | |||
| </view> | |||
| </view> | |||
| <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> | |||
| <view> | |||
| <image class="rArrow" src="{{chevronUrl}}" mode='widthFix'></image> | |||
| </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> | |||
| <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> | |||
| <!-- 适用门店 --> | |||
| <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> | |||
| </view> | |||
| </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> | |||
| <image tt:if="{{order.type == 69}}" class="alerting" mode='widthFix' src="../../../assets/images/appointment.png"> | |||
| </image> | |||
| <view class='notes'> | |||
| <view class="notesH"> | |||
| 购买须知 | |||
| </view> | |||
| <view class="timeText">使用期</view> | |||
| <view class="Hchild">• {{order.validStartDate}}至{{order.validEndDate}}</view> | |||
| <view tt:if="{{order.soldStartTime && order.soldEndTime}}"> | |||
| <view class="timeText">售卖期</view> | |||
| <view class="Hchild">• {{order.soldStartTime}}至{{order.soldEndTime}}</view> | |||
| </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 tt:if="{{ order.useLimitQuantity }}" class="timeText">购买限制</view> | |||
| <view tt:if="{{ order.useLimitQuantity }}" class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</view> | |||
| <view tt:if="{{ use_num_per_consume }}" class="timeText">使用限制</view> | |||
| <view tt:if="{{ use_num_per_consume }}" class="Hchild">• 每个用户仅可用{{use_num_per_consume}}张</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 tt:if="{{ order.pack || order.besides || order.superimposed_discounts || | |||
| order.private_room }}" class="timeText"> | |||
| 温馨提示</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> | |||
| <text tt:if="{{ data.remark }}" class="notesText">{{ data.remark }}</text> | |||
| <view tt:if="{{ contentType == 1 }}"> | |||
| <import src="../../freeBannerDetail/ttParse/wxParse.ttml" /> | |||
| <view class="content" style="width: 750rpx;padding: 0 20rpx;"> | |||
| <template is="wxParse" data="{{wxParseData:article.nodes}}" /> | |||
| </view> | |||
| </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 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 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> | |||
| <view class='notes'> | |||
| <view class="notesH">购买须知</view> | |||
| <view class="notesH">购买须知</view> | |||
| <view class="timeText">有效期</view> | |||
| <view class="Hchild">• {{order.validStartDate}}至{{order.validEndDate}}</view> | |||
| <view tt:if="{{order.soldStartTime && order.soldEndTime}}"> | |||
| <view class="timeText">售卖期</view> | |||
| <view class="Hchild">• {{order.soldStartTime}}至{{order.soldEndTime}}</view> | |||
| </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="Hchild" tt:if="{{order.can_no_use_date.HolidaysFlag}}">• 节假日(元旦、春节、清明、劳动节、端午节、中秋节、国庆节、情人节、圣诞节)不支持使用 | |||
| </view> | |||
| <view class="timeText">购买限制</view> | |||
| <view class="Hchild">• 每个用户限购{{order.useLimitQuantity}}单</view> | |||
| @@ -192,25 +335,26 @@ | |||
| <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="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">• 该优惠券不支持配送或外卖</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.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 class="childList" tt:if="{{order.type==12}}"> | |||
| <view class="childTitle">礼券:</view> | |||
| @@ -242,14 +386,16 @@ | |||
| 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="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> | |||
| @@ -264,4 +410,4 @@ | |||
| </view> | |||
| </view> | |||
| </view> | |||
| <!-- --> | |||
| <!-- --> | |||
| @@ -1,4 +1,5 @@ | |||
| @import "../../../app.ttss"; | |||
| @import "../../freeBannerDetail/ttParse/wxParse.ttss"; | |||
| button::after { | |||
| border: none; | |||
| @@ -7,7 +8,51 @@ button::after { | |||
| page { | |||
| height: auto !important; | |||
| background: #f4f5f9; | |||
| } | |||
| .content { | |||
| width: 710rpx; | |||
| padding: 0 20rpx; | |||
| background-color: #ffffff; | |||
| } | |||
| .serviceBOX { | |||
| position: fixed; | |||
| top: 50%; | |||
| right: 10%; | |||
| width: 50rpx; | |||
| height: 50rpx; | |||
| z-index: 99999; | |||
| } | |||
| .alerting { | |||
| width: 100%; | |||
| } | |||
| .cancelAppoint { | |||
| color: #ffffff; | |||
| background-color: #ff0000; | |||
| border-radius: 5rpx; | |||
| padding: 5rpx 3rpx; | |||
| } | |||
| .serviceBox2 { | |||
| width: 50rpx; | |||
| height: 50rpx; | |||
| background-color: #00000000; | |||
| margin-top: 20rpx; | |||
| } | |||
| .fuwuLogoBox { | |||
| width: 50rpx; | |||
| height: 50rpx; | |||
| line-height: 0; | |||
| } | |||
| .itemLogo { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| .order { | |||
| @@ -124,6 +169,7 @@ page { | |||
| width: 100%; | |||
| position: relative; | |||
| } | |||
| .infoArrow { | |||
| position: absolute; | |||
| right: 26rpx; | |||
| @@ -187,12 +233,13 @@ page { | |||
| padding-right: 5%; | |||
| } | |||
| .barnumImg{ | |||
| .barnumImg { | |||
| float: left; | |||
| height: 40rpx; | |||
| width: 40rpx; | |||
| margin: 24rpx 20rpx; | |||
| margin: 24rpx 20rpx; | |||
| } | |||
| .classif { | |||
| background: #fff; | |||
| width: 100%; | |||
| @@ -228,7 +275,7 @@ page { | |||
| .left { | |||
| float: left; | |||
| font-size: 26rpx; | |||
| color: #a6a6a6; | |||
| color: #a6a6a6; | |||
| } | |||
| .copeCode { | |||
| @@ -239,7 +286,7 @@ page { | |||
| line-height: 30rpx; | |||
| border-radius: 8rpx; | |||
| color: #df3502; | |||
| border:1rpx #a6a6a6 solid; | |||
| border: 1rpx #a6a6a6 solid; | |||
| font-size: 28rpx; | |||
| } | |||
| @@ -250,7 +297,7 @@ page { | |||
| padding: 10rpx; | |||
| height: 30rpx; | |||
| line-height: 30rpx; | |||
| border:1rpx #a6a6a6 solid; | |||
| border: 1rpx #a6a6a6 solid; | |||
| border-radius: 8rpx; | |||
| color: #3cc51f; | |||
| font-size: 28rpx; | |||
| @@ -279,7 +326,8 @@ page { | |||
| line-height:94rpx; | |||
| } */ | |||
| .classif > view:nth-child(2), .classif > view:nth-child(3) { | |||
| .classif>view:nth-child(2), | |||
| .classif>view:nth-child(3) { | |||
| position: relative; | |||
| height: 94rpx; | |||
| line-height: 94rpx; | |||
| @@ -290,22 +338,22 @@ page { | |||
| /* border-bottom: 1rpx solid #eee; */ | |||
| } | |||
| .classif > view text:nth-child(2) { | |||
| .classif>view text:nth-child(2) { | |||
| font-size: 28rpx; | |||
| /* color: #3c3c3c; */ | |||
| } | |||
| .classif > view text:nth-child(1) { | |||
| .classif>view text:nth-child(1) { | |||
| font-size: 28rpx; | |||
| color: #a6a6a6; | |||
| float: left; | |||
| } | |||
| .classif > view:nth-child(1) { | |||
| .classif>view:nth-child(1) { | |||
| display: block; | |||
| } | |||
| .classif > view:nth-child(6) text:nth-child(2) { | |||
| .classif>view:nth-child(6) text:nth-child(2) { | |||
| color: #666; | |||
| } | |||
| @@ -361,7 +409,8 @@ page { | |||
| .drawer_content { | |||
| height: 210px; | |||
| overflow-y: scroll; /*超出父盒子高度可滚动*/ | |||
| overflow-y: scroll; | |||
| /*超出父盒子高度可滚动*/ | |||
| } | |||
| .btn_ok { | |||
| @@ -495,7 +544,7 @@ radio { | |||
| color: #333; | |||
| } | |||
| .barcode > canvas { | |||
| .barcode>canvas { | |||
| width: 500rpx; | |||
| height: 100rpx; | |||
| } | |||
| @@ -508,7 +557,7 @@ radio { | |||
| align-items: center; | |||
| } | |||
| .qrcode > canvas { | |||
| .qrcode>canvas { | |||
| width: 350rpx; | |||
| height: 350rpx; | |||
| } | |||
| @@ -563,6 +612,7 @@ radio { | |||
| line-height: 94rpx; | |||
| border-radius: 61rpx; | |||
| } | |||
| .buyX { | |||
| background: linear-gradient(180deg, #cc9a60 0%, #dfbf8e 100%); | |||
| height: 94rpx; | |||
| @@ -573,46 +623,53 @@ radio { | |||
| line-height: 94rpx; | |||
| border-radius: 61rpx; | |||
| } | |||
| .salePriceStr{ | |||
| .salePriceStr { | |||
| color: #999; | |||
| letter-spacing: 0; | |||
| padding-left: 4%; | |||
| overflow: hidden; | |||
| } | |||
| .subTitle{ | |||
| .subTitle { | |||
| font-size: 22rpx; | |||
| color: #b8b8b8; | |||
| padding-left: 4%; | |||
| letter-spacing: 0; | |||
| } | |||
| .xidanTiem{ | |||
| .xidanTiem { | |||
| padding-left: 4%; | |||
| color: #b8b8b8; | |||
| letter-spacing: 0; | |||
| font-size: 22rpx; | |||
| } | |||
| .rmb { | |||
| color: #d5af67 ; | |||
| font-size: 24rpx ; | |||
| line-height: 40rpx ; | |||
| float: left ; | |||
| color: #d5af67; | |||
| font-size: 24rpx; | |||
| line-height: 40rpx; | |||
| float: left; | |||
| } | |||
| .pri01 { | |||
| font-size: 36rpx ; | |||
| color: #d5af67 ; | |||
| letter-spacing: 0 ; | |||
| line-height: 40rpx ; | |||
| float: left ; | |||
| font-size: 36rpx; | |||
| color: #d5af67; | |||
| letter-spacing: 0; | |||
| line-height: 40rpx; | |||
| float: left; | |||
| } | |||
| .throgh { | |||
| text-decoration: line-through ; | |||
| margin-left: 10rpx ; | |||
| color: #999 ; | |||
| height: 32rpx ; | |||
| line-height: 45rpx ; | |||
| text-decoration: line-through; | |||
| margin-left: 10rpx; | |||
| color: #999; | |||
| height: 32rpx; | |||
| line-height: 45rpx; | |||
| float: left; | |||
| font-size: 26rpx; | |||
| } | |||
| .active { | |||
| opacity: 0.6; | |||
| } | |||
| @@ -779,15 +836,19 @@ radio { | |||
| letter-spacing: 0; | |||
| margin-left: 20rpx; | |||
| } | |||
| .groupTextBox{ | |||
| .groupTextBox { | |||
| background: #fff; | |||
| overflow: hidden; | |||
| padding-bottom: 10rpx; | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .groupTitleBox{ | |||
| .groupTitleBox { | |||
| background: #fff; | |||
| } | |||
| .groupTitle{ | |||
| .groupTitle { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 30rpx; | |||
| @@ -797,7 +858,8 @@ radio { | |||
| margin: 0 auto; | |||
| font-weight: bold; | |||
| } | |||
| .groupTitleS{ | |||
| .groupTitleS { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 28rpx; | |||
| @@ -807,25 +869,30 @@ radio { | |||
| margin: 0 auto; | |||
| /* font-weight: bold; */ | |||
| } | |||
| .groupDetailsBox{ | |||
| .groupDetailsBox { | |||
| width: 90%; | |||
| margin: 0 auto; | |||
| } | |||
| .groupTiemBox{ | |||
| .groupTiemBox { | |||
| color: #333333; | |||
| overflow: hidden; | |||
| } | |||
| .groupTiemName{ | |||
| .groupTiemName { | |||
| float: left; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .groupTiemPay{ | |||
| .groupTiemPay { | |||
| float: right; | |||
| font-size: 26rpx; | |||
| /* color: #a6a6a6; */ | |||
| } | |||
| .yuandian{ | |||
| .yuandian { | |||
| background-color: #333333; | |||
| width: 4rpx; | |||
| @@ -834,20 +901,23 @@ radio { | |||
| margin: 16rpx 8rpx 0 0; | |||
| float: left; | |||
| } | |||
| .notes { | |||
| width: 100%; | |||
| background: #fff; | |||
| padding-bottom: 30rpx; | |||
| } | |||
| .notesH{ | |||
| .notesH { | |||
| width: 92%; | |||
| font-weight: bold; | |||
| font-size: 32rpx; | |||
| color: #3c3c3c; | |||
| margin: 10rpx auto; | |||
| margin: 10rpx auto; | |||
| padding-top: 10rpx; | |||
| } | |||
| .timeText{ | |||
| .timeText { | |||
| color: #333; | |||
| letter-spacing: 0; | |||
| font-size: 14px; | |||
| @@ -856,7 +926,8 @@ radio { | |||
| width: 92%; | |||
| margin: 10rpx auto; | |||
| } | |||
| .Hchild{ | |||
| .Hchild { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -866,7 +937,8 @@ radio { | |||
| line-height: 21px; | |||
| display: block; | |||
| } | |||
| .notesText{ | |||
| .notesText { | |||
| width: 92%; | |||
| margin: 0 auto; | |||
| color: #333; | |||
| @@ -875,66 +947,80 @@ radio { | |||
| letter-spacing: 0; | |||
| line-height: 42rpx; | |||
| display: block; | |||
| } | |||
| } | |||
| .panel{ | |||
| .panel { | |||
| position: relative; | |||
| } | |||
| .closeRq{ | |||
| .closeRq { | |||
| position: absolute; | |||
| width: 420rpx; | |||
| width: 420rpx; | |||
| height: 420rpx; | |||
| line-height: 420rpx; | |||
| text-align: center; | |||
| background-color: rgba(0, 0, 0, 0.8); | |||
| left: 50%; top: 50%; | |||
| transform: translate(-50%, -50%); /* 50%为自身尺寸的一半 */ | |||
| left: 50%; | |||
| top: 50%; | |||
| transform: translate(-50%, -50%); | |||
| /* 50%为自身尺寸的一半 */ | |||
| z-index: 10000000; | |||
| color: #fff; | |||
| font-size: 38rpx; | |||
| } | |||
| .updataRqCode{ | |||
| .updataRqCode { | |||
| width: 80rpx !important; | |||
| height: 80rpx !important; | |||
| margin-top: calc(50%-80rpx) !important; | |||
| margin-left: calc(50%-80rpx) !important; | |||
| display: inline-block !important; | |||
| } | |||
| .upDataRq{ | |||
| .upDataRq { | |||
| position: absolute; | |||
| width: 100%; | |||
| text-align: center; | |||
| height: 80rpx; | |||
| color: #fff ; | |||
| color: #fff; | |||
| top: 20%; | |||
| left: 0; | |||
| } | |||
| .coedTiem{ | |||
| .coedTiem { | |||
| text-align: center; | |||
| /* color: rgba(253,131,45,1); */ | |||
| margin-bottom: 20rpx; | |||
| } | |||
| .zhuangtai{ | |||
| .zhuangtai { | |||
| margin-top: 20rpx; | |||
| width: 100%; | |||
| background-color: #fff; | |||
| } | |||
| .panel, .zhuangtai image { | |||
| width:500rpx; | |||
| display:block; | |||
| border-radius:10rpx; | |||
| margin:0 auto; | |||
| padding:0; | |||
| z-index:10000; | |||
| .panel, | |||
| .zhuangtai image { | |||
| width: 500rpx; | |||
| display: block; | |||
| border-radius: 10rpx; | |||
| margin: 0 auto; | |||
| padding: 0; | |||
| z-index: 10000; | |||
| overflow: hidden; | |||
| } | |||
| .panel{ | |||
| .panel { | |||
| position: relative; | |||
| } | |||
| .goRefund{ | |||
| .goRefundPayBtn { | |||
| float: right; | |||
| margin-right: 26rpx; | |||
| } | |||
| .goRefund { | |||
| border: 1rpx solid #d4a971; | |||
| border-radius: 50rpx; | |||
| color: #3c3c3c; | |||
| @@ -945,40 +1031,43 @@ radio { | |||
| margin-right: 26rpx; | |||
| } | |||
| .evaluate{ | |||
| .evaluate { | |||
| width: 80%; | |||
| margin: 20rpx auto; | |||
| background-color: #d4a971; | |||
| color: #fff; | |||
| font-size: 32rpx; | |||
| text-align: center; | |||
| padding: 10rpx 0 ; | |||
| padding: 10rpx 0; | |||
| border-radius: 25rpx; | |||
| } | |||
| .serviceBox{ | |||
| margin: 40rpx auto; | |||
| overflow: hidden; | |||
| border: #d4a971 1px solid; | |||
| border-radius: 24rpx; | |||
| text-align: center; | |||
| padding: 6rpx; | |||
| font-size: 26rpx; | |||
| color: #d4a971; | |||
| width: 240rpx; | |||
| .serviceBox { | |||
| margin: 40rpx auto; | |||
| overflow: hidden; | |||
| border: #d4a971 1px solid; | |||
| border-radius: 24rpx; | |||
| text-align: center; | |||
| padding: 6rpx; | |||
| font-size: 26rpx; | |||
| color: #d4a971; | |||
| width: 240rpx; | |||
| } | |||
| .serviceImg{ | |||
| .serviceImg { | |||
| width: 30rpx; | |||
| height: 30rpx; | |||
| float: left; | |||
| margin-left: 20rpx; | |||
| margin-top: 6rpx; | |||
| } | |||
| .serviceText{ | |||
| .serviceText { | |||
| float: left; | |||
| margin-left: 10rpx; | |||
| } | |||
| .explainText{ | |||
| .explainText { | |||
| margin-top: 20rpx; | |||
| text-align: center; | |||
| font-size: 24rpx; | |||
| @@ -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); | |||
| @@ -176,13 +209,27 @@ Page({ | |||
| }, | |||
| gotopay: function (e) { | |||
| let level = e.currentTarget.dataset.level | |||
| const params = { | |||
| orderId: e.currentTarget.dataset.id, | |||
| mallTenantId: this.data.mallTenantId, | |||
| flag: 'pay' | |||
| } | |||
| if (level == 0) { | |||
| // tt.navigateTo({ | |||
| // url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&mallTenantId=${this.data.mallTenantId}&flag='pay'` | |||
| // }) | |||
| tt.navigateTo({ | |||
| url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&flag='pay'` | |||
| url: `/pages/order/detail/index?params=${JSON.stringify(params) }` | |||
| }) | |||
| } else { | |||
| // tt.navigateTo({ | |||
| // url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&mallTenantId=${this.data.mallTenantId}&dingdan=order&flag='pay'` | |||
| // }) | |||
| params.dingdan = 'order' | |||
| tt.navigateTo({ | |||
| url: `/pages/order/detail/index?orderId=${e.currentTarget.dataset.id}&dingdan=order&flag='pay'` | |||
| url: `/pages/order/detail/index?params=${JSON.stringify(params) }` | |||
| }) | |||
| } | |||
| @@ -211,18 +258,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 +281,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 +338,7 @@ Page({ | |||
| showCancel: false | |||
| }) | |||
| }) | |||
| } | |||
| else { | |||
| } else { | |||
| that.setData({ | |||
| loading: true, | |||
| content: "——— 再拉裤子就掉了啦 ———" | |||
| @@ -302,7 +350,7 @@ Page({ | |||
| }, 1400) | |||
| } | |||
| }, | |||
| handleChange({ | |||
| handleChange({ | |||
| detail | |||
| }) { | |||
| this.setData({ | |||
| @@ -311,19 +359,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 | |||
| }) | |||
| } | |||
| }, | |||
| @@ -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"> | |||
| @@ -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; | |||
| @@ -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,22 +106,22 @@ 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 | |||
| console.log(options) | |||
| console.log(app.globalData.curHtml) | |||
| let that = this; | |||
| // let value = JSON.stringify({ END: "C", TYPE: "couponorder", ID: options.quancode}) | |||
| // that.createQrCode(value, "qrcode", 350, 350); | |||
| @@ -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, | |||
| // }) | |||
| // } | |||
| }); | |||
| }); | |||
| @@ -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({ | |||
| @@ -459,7 +487,7 @@ Page({ | |||
| curHtml: decodeURI(res.data.html) | |||
| }) | |||
| app.globalData.curHtml = this.data.curHtml; | |||
| console.log(app.globalData.curHtml) | |||
| } | |||
| }) | |||
| }, | |||
| @@ -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) { | |||
| @@ -653,7 +683,7 @@ Page({ | |||
| } | |||
| if (item.key == 'Description') { | |||
| if (item.key == 'Description' && item.isRequired) { | |||
| tempObj.Description = JSON.parse(item.data) | |||
| } | |||
| if (item.key == "can_no_use_date") { | |||
| @@ -681,11 +711,11 @@ Page({ | |||
| }); | |||
| }) | |||
| }, | |||
| onShow() { | |||
| this.ifGetUser()//判断是否授权抖音 | |||
| this.ifGetUser() //判断是否授权抖音 | |||
| this.setData({ | |||
| mouldType: app.globalData.mouldType, | |||
| showbutton: false, | |||
| @@ -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}}" | |||
| @@ -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() | |||
| } | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,559 @@ | |||
| // c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttc\package2\pages\appointment\appointment.js | |||
| let config = require("../../config/config.js"); | |||
| let util = require("../../utils/util"); | |||
| let Http = require("../../utils/HttpBasics"); | |||
| let app = getApp(); | |||
| const imgurl = require("../../utils/imgurl"); | |||
| Page({ | |||
| data: { | |||
| appointmentText: "确认预约", | |||
| id: "", | |||
| orderId: "", | |||
| merOrderId: "", | |||
| startTime: '', | |||
| endTime: "", | |||
| mallTenantId: "", | |||
| pickedAddress: "请选择地址", | |||
| isDetail: false, | |||
| pickedAddressDetail: "", | |||
| pickedDate: "请选择日期", | |||
| pickedStartTime: "请选择", | |||
| pickedEndTime: "请选择", | |||
| reservationMerchantName: "", | |||
| describeStr: "", | |||
| mallList: [], | |||
| merchantId: "", | |||
| currentIndex: "", | |||
| status: "", | |||
| isShowBtns: false, | |||
| latitude: "", | |||
| longitude: "", | |||
| shopItem: null | |||
| }, | |||
| onLoad(options) { | |||
| console.log(options, 'options') | |||
| const mallTenantId = tt.getStorageSync('mallTenantId'); | |||
| if (mallTenantId) { | |||
| this.setData({ | |||
| mallTenantId | |||
| }) | |||
| } | |||
| const date = (new Date()).getTime() | |||
| const nowDate = util.timestampToTime(date, 'YYYY-MM-DD') | |||
| const startTime = util.timestampToTime(options.startTime * 1, 'YYYY-MM-DD') | |||
| console.log(nowDate, startTime, 'time'); | |||
| const finalStartTime = options.startTime * 1 > date * 1 ? startTime : nowDate | |||
| console.log(finalStartTime, 'finalStartTime'); | |||
| // const mallList = [{ | |||
| // merchantName: "1家帮汇家政保洁(河池市庆远镇)", | |||
| // latitude: 50.277748, | |||
| // longitude: 119.996078, | |||
| // id: 1 | |||
| // }, { | |||
| // merchantName: "2家帮汇家政保洁(河池市庆远镇)", | |||
| // latitude: 35.277748, | |||
| // longitude: 119.996078, | |||
| // id: 2 | |||
| // }, { | |||
| // merchantName: "3家帮汇家政保洁(河池市庆远镇)", | |||
| // id: 3 | |||
| // }, { | |||
| // merchantName: "4家帮汇家政保洁(河池市庆远镇)", | |||
| // latitude: 45.277748, | |||
| // longitude: 119.996078, | |||
| // id: 4 | |||
| // }] | |||
| this.setData({ | |||
| id: options.id || '', | |||
| orderId: options.orderId || '', | |||
| merOrderId: options.merOrderId || '', | |||
| startTime: finalStartTime, | |||
| endTime: options.endTime || '', | |||
| }) | |||
| // this.getCouponMerchant() | |||
| if (this.data.id) { | |||
| this.getDetail(this.data.id) | |||
| } else { | |||
| this.setData({ | |||
| isShowBtns: true | |||
| }) | |||
| } | |||
| }, | |||
| goSelectShop() { | |||
| const data = this.data | |||
| const id = data.id | |||
| const orderId = data.orderId | |||
| const merOrderId = data.merOrderId | |||
| const startTime = data.startTime | |||
| const endTime = data.endTime | |||
| tt.navigateTo({ | |||
| url: `/pages2/shopSelect/shopSelect?id=${id}&orderId=${orderId}&merOrderId=${merOrderId}&startTime=${startTime}&endTime=${endTime}`, | |||
| }); | |||
| }, | |||
| setMerchant(e) { | |||
| console.log(e.detail.value, 'e'); | |||
| const index = e.detail.value | |||
| this.setData({ | |||
| currentIndex: index, | |||
| merchantId: this.data.mallList[index].id, | |||
| reservationMerchantName: '' | |||
| }) | |||
| console.log(this.data.currentIndex, this.data.merchantId); | |||
| }, | |||
| /** | |||
| * 获得经纬度 | |||
| */ | |||
| getLocation() { | |||
| console.log('getLocation'); | |||
| let that = this; | |||
| tt.getLocation({ | |||
| type: "wgs84", | |||
| // isHighAccuracy: true, | |||
| success: function (res) { | |||
| console.log(res, 'getLocation') | |||
| that.setData({ | |||
| latitude: res.latitude, | |||
| longitude: res.longitude, | |||
| }) | |||
| const latitudeNow = res.latitude | |||
| const longitudeNow = res.longitude | |||
| const mallLocationArr = [] | |||
| const mallList = that.data.mallList | |||
| mallList.forEach((item, index) => { | |||
| const obj = { | |||
| latitude: item.latitude || false, | |||
| longitude: item.longitude || false, | |||
| id: item.id, | |||
| index: index | |||
| } | |||
| mallLocationArr.push(obj) | |||
| }) | |||
| console.log(mallLocationArr, 'mallLocationArr'); | |||
| const tempArr = mallList | |||
| const bloobArr = [] | |||
| mallLocationArr.forEach((item, index) => { | |||
| const distanceData = that.getDistances(latitudeNow, longitudeNow, item.latitude, item.longitude) | |||
| tempArr[index].distance_str = distanceData.distance_str | |||
| tempArr[index].distanceName = tempArr[index].merchantName + ' ' + distanceData.distance_str | |||
| tempArr[index].distance = distanceData.distance | |||
| bloobArr.push(tempArr[index]) | |||
| }) | |||
| const finalSortMallList = that.bloob(bloobArr) | |||
| console.log(finalSortMallList, 'finalSortMallList'); | |||
| that.setData({ | |||
| mallList: finalSortMallList | |||
| }) | |||
| }, | |||
| // 拒绝提供定位权限 | |||
| fail: error => { | |||
| console.log(error, 'error'); | |||
| const mallList = that.data.mallList | |||
| mallList.forEach(item => { | |||
| item.distanceName = item.merchantName | |||
| }) | |||
| that.setData({ | |||
| mallList | |||
| }) | |||
| }, | |||
| complete: finish => { | |||
| let isSuccess = 0 | |||
| const mallList = that.data.mallList | |||
| mallList.forEach(item => { | |||
| if (item.distance_str) { | |||
| isSuccess = 1 | |||
| } | |||
| }) | |||
| if (!isSuccess) { | |||
| tt.showToast({ | |||
| title: '定位失败!', | |||
| icon: "fail" | |||
| }); | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| getCouponMerchant() { //获取适用门店 | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.orderDetail, | |||
| data: { | |||
| orderId: that.data.merOrderId, | |||
| mallTenantId: that.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| const couponChannelId = res.data.orders[0].couponChannelId | |||
| Http.get({ | |||
| url: config.api.couponMerchant, | |||
| data: { | |||
| couponChannelId, | |||
| mallTenantId: that.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++ | |||
| }) | |||
| that.setData({ | |||
| mallList: mallList[0].merchantVoList | |||
| }) | |||
| console.log(that.data.mallList, 'mallList'); | |||
| that.getLocation() | |||
| }) | |||
| }).catch(err => { | |||
| }) | |||
| }, | |||
| chooseAddress() { | |||
| if (!this.data.isShowBtns) return | |||
| let that = this; | |||
| tt.chooseLocation({ | |||
| success: function (res) { | |||
| that.setData({ | |||
| pickedAddress: res.address, | |||
| isDetail: true | |||
| }) | |||
| }, | |||
| fail: function (error) { | |||
| console.log(error) | |||
| that.setData({ | |||
| isDetail: true | |||
| }) | |||
| tt.showModal({ | |||
| title: '提示', | |||
| content: '请点击右上角:更多-权限设置-开启地理位置授权,或直接填写详细地址', | |||
| showCancel: false, | |||
| confirmText: "知道了", | |||
| success: (res) => { | |||
| }, | |||
| fail: (res) => { | |||
| }, | |||
| }); | |||
| }, | |||
| complete: function (data) {} | |||
| }) | |||
| }, | |||
| chooseAddressDetail() { | |||
| this.setData({ | |||
| pickedAddressDetailFlag: false | |||
| }) | |||
| }, | |||
| chooseDate(e) { | |||
| console.log(e.detail.value, 'e'); | |||
| this.setData({ | |||
| pickedDate: e.detail.value | |||
| }) | |||
| }, | |||
| chooseStartTime(e) { | |||
| console.log(e.detail.value, 'e'); | |||
| this.setData({ | |||
| pickedStartTime: e.detail.value | |||
| }) | |||
| }, | |||
| chooseEndTime(e) { | |||
| console.log(e.detail.value, 'e'); | |||
| this.setData({ | |||
| pickedEndTime: e.detail.value | |||
| }) | |||
| }, | |||
| inputAddressDetail(e) { | |||
| this.setData({ | |||
| pickedAddressDetail: e.detail.value | |||
| }) | |||
| }, | |||
| describing(e) { | |||
| this.setData({ | |||
| describeStr: e.detail.value | |||
| }) | |||
| }, | |||
| confirm() { | |||
| const tempData = this.data | |||
| if (tempData.pickedAddress == '请选择地址' && !tempData.pickedAddressDetail) { | |||
| tt.showToast({ | |||
| title: '请选择或填写地址!', | |||
| icon: 'fail' | |||
| }); | |||
| return | |||
| } | |||
| if (tempData.pickedDate == '请选择日期') { | |||
| tt.showToast({ | |||
| title: '请请选择日期!', | |||
| icon: 'fail' | |||
| }); | |||
| return | |||
| } | |||
| if (tempData.pickedStartTime == '请选择') { | |||
| tt.showToast({ | |||
| title: '请起始时间!', | |||
| icon: 'fail' | |||
| }); | |||
| return | |||
| } | |||
| if (tempData.pickedEndTime == '请选择') { | |||
| tt.showToast({ | |||
| title: '请结束时间!', | |||
| icon: 'fail' | |||
| }); | |||
| return | |||
| } | |||
| const data = { | |||
| couponOrderId: tempData.orderId, | |||
| userAddress: tempData.pickedAddress, | |||
| detailedAddress: tempData.pickedAddressDetail, | |||
| startDate: tempData.pickedDate + " " + tempData.pickedStartTime + ":00", | |||
| endDate: tempData.pickedDate + " " + tempData.pickedEndTime + ":00", | |||
| describeStr: tempData.describeStr, | |||
| mallTenantId: tempData.mallTenantId || '', | |||
| reservationMerchantId: tempData.merchantId | |||
| } | |||
| if (this.data.id) { | |||
| data.id = this.data.id | |||
| } | |||
| if (this.data.status == 1 || this.data.status == '-1') { | |||
| data.status = 0 | |||
| } | |||
| console.log(data, 'data'); | |||
| this.saveOrderReservation(data) | |||
| }, | |||
| cancel() { | |||
| tt.showModal({ | |||
| title: "取消预约", | |||
| content: "确定要取消预约吗?", | |||
| showCancel: true, | |||
| success: (res) => { | |||
| if (res.confirm) { | |||
| this.cancelReservation(this.data.id) | |||
| } | |||
| if (res.cancel) { | |||
| return | |||
| } | |||
| }, | |||
| fail: (res) => { | |||
| }, | |||
| }); | |||
| }, | |||
| cancelReservation(id) { | |||
| const that = this | |||
| Http.post({ | |||
| url: config.api.cancelReservation, | |||
| data: { | |||
| id, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'cancelReservation'); | |||
| tt.showToast({ | |||
| title: '取消成功!', | |||
| icon: 'success', | |||
| duration: 2000, | |||
| success: (res) => { | |||
| setTimeout(() => { | |||
| tt.navigateBack(); | |||
| }, 1500); | |||
| }, | |||
| fail: (res) => { | |||
| }, | |||
| }); | |||
| }).catch(err => { | |||
| console.log(err, 'cancelReservation'); | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none' | |||
| }); | |||
| }) | |||
| }, | |||
| saveOrderReservation(data) { | |||
| Http.post({ | |||
| url: config.api.saveOrderReservation, | |||
| data | |||
| }).then(res => { | |||
| console.log(res, 'saveOrderReservation'); | |||
| tt.showToast({ | |||
| title: '预约成功!', | |||
| icon: 'success', | |||
| duration: 2000, | |||
| success: (res) => { | |||
| setTimeout(() => { | |||
| tt.navigateBack(); | |||
| }, 1500); | |||
| }, | |||
| fail: (res) => { | |||
| }, | |||
| }); | |||
| }).catch(err => { | |||
| console.log(err, 'saveOrderReservation'); | |||
| tt.showToast({ | |||
| title: err.message, | |||
| icon: 'none' | |||
| }); | |||
| }) | |||
| }, | |||
| getDetail(id) { | |||
| const that = this | |||
| Http.get({ | |||
| url: config.api.getOrderReservationDetail, | |||
| data: { | |||
| id, | |||
| mallTenantId: this.data.mallTenantId || '' | |||
| } | |||
| }).then(res => { | |||
| console.log(res, 'getOrderReservationDetail'); | |||
| const status = res.data.status | |||
| that.setData({ | |||
| pickedAddress: res.data.userAddress || '请选择地址', | |||
| pickedAddressDetail: res.data.detailedAddress, | |||
| isDetail: true, | |||
| pickedDate: util.timestampToTime(res.data.startDate, 'YYYY-MM-DD') || '请选择日期', | |||
| pickedStartTime: util.timestampToTime(res.data.startDate, 'hh:mm') || '请选择', | |||
| pickedEndTime: util.timestampToTime(res.data.endDate, 'hh:mm') || '请选择', | |||
| describeStr: res.data.describeStr, | |||
| status, | |||
| appointmentText: res.data.status == 1 ? "重新预约" : "修改预约", | |||
| merchantId: res.data.reservationMerchantId, | |||
| reservationMerchantName: res.data.reservationMerchantName | |||
| }) | |||
| if (status == 0 || status == 1 || status == 2 || status == 3 || status == '-1') { | |||
| that.setData({ | |||
| isShowBtns: true | |||
| }) | |||
| } | |||
| }).catch(err => { | |||
| console.log(err, 'getOrderReservationDetail'); | |||
| }) | |||
| }, | |||
| /** | |||
| * @description:根据经纬度计算距离 | |||
| * @param {*} locationInfo (lat1, lng1, lat2, lng2) | |||
| * @return: distanceObj: { distance , distance_str } | |||
| */ | |||
| getDistances(lat1, lng1, lat2, lng2) { | |||
| if (lat2 || lng2) { | |||
| function rad(num) { | |||
| return num * Math.PI / 180.0; | |||
| } | |||
| var radLat1 = rad(lat1); | |||
| var radLat2 = rad(lat2); | |||
| var a = radLat1 - radLat2; | |||
| var b = rad(lng1) - rad(lng2); | |||
| var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + | |||
| Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); | |||
| s = s * 6378.137; | |||
| s = Math.round(s * 10000) / 10000; | |||
| var distance = s; | |||
| var distance_str = ""; | |||
| if (parseInt(distance) >= 1) { | |||
| distance_str = distance.toFixed(2) + "km"; | |||
| } else if (!arseInt(distance)) { | |||
| return false | |||
| } else { | |||
| distance_str = (distance * 1000).toFixed(2) + "m"; | |||
| } | |||
| let objData = { | |||
| distance: distance, | |||
| distance_str: distance_str | |||
| } | |||
| return objData | |||
| } else { | |||
| let objData = { | |||
| distance: Infinity, | |||
| distance_str: '' | |||
| } | |||
| return objData | |||
| } | |||
| }, | |||
| bloob(arr) { | |||
| const tempArr = arr | |||
| for (let i = 0; i < tempArr.length - 1; i++) { | |||
| for (let j = 0; j < tempArr.length - 1 - i; j++) { | |||
| if (tempArr[j].distance > tempArr[j + 1].distance) { | |||
| let temp = tempArr[j]; | |||
| tempArr[j] = tempArr[j + 1]; | |||
| tempArr[j + 1] = temp; | |||
| } | |||
| } | |||
| } | |||
| return tempArr | |||
| }, | |||
| onShow() { | |||
| const shopItem = app.globalData.shopItem | |||
| if (shopItem) { | |||
| this.setData({ | |||
| shopItem, | |||
| merchantId: shopItem.id, | |||
| reservationMerchantName: "" | |||
| }) | |||
| console.log(this.data.shopItem, 'shopItem'); | |||
| app.globalData.shopItem = null | |||
| } | |||
| } | |||
| }) | |||
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "navigationBarTitleText": "订单预约", | |||
| "navigationBarBackgroundColor": "#fff", | |||
| "navigationBarTextStyle": "black", | |||
| "usingComponents": {} | |||
| } | |||
| @@ -0,0 +1,89 @@ | |||
| <!-- c:\Users\Holy-Knight-IX\Desktop\Working Space\4.TikTok-MiniPro\ttc\package2\pages\appointment\appointment.ttml --> | |||
| <view class="continer"> | |||
| <view tt:if="{{ pickedAddress != '请选择地址' }}" class="addressPicker" bindtap="chooseAddress"> | |||
| <text>选择服务地点:</text> | |||
| <text> | |||
| <text class="address">{{ pickedAddress }}</text> | |||
| </text> | |||
| </view> | |||
| <view tt:if="{{ pickedAddress == '请选择地址' }}" class="addressPickerFlex" bindtap="chooseAddress"> | |||
| <text>选择服务地点:</text> | |||
| <text> | |||
| <text class="address">{{ pickedAddress }}</text> | |||
| </text> | |||
| </view> | |||
| <view tt:if="{{ isDetail }}" class="addressTextarea"> | |||
| <textarea class="describe" placeholder="请填写详细地址:单元楼、门牌号等" bindinput="inputAddressDetail" | |||
| value="{{ pickedAddressDetail }}"></textarea> | |||
| </view> | |||
| <view class="datePickerFlex"> | |||
| <picker mode="date" start="{{ startTime }}" end="{{ endTime }}" disabled="{{ !isShowBtns }}" | |||
| bindchange='chooseDate'>选择服务日期:</picker> | |||
| <picker mode="date" start="{{ startTime }}" end="{{ endTime }}" disabled="{{ !isShowBtns }}" | |||
| bindchange='chooseDate' class="address"> | |||
| {{ pickedDate }}</picker> | |||
| </view> | |||
| <view class="datePickerFlex"> | |||
| <picker mode="time" disabled="{{ !isShowBtns }}" bindchange='chooseTime'>预计上门时间:</picker> | |||
| <picker mode="time" disabled="{{ !isShowBtns }}" bindchange='chooseStartTime' class="address">{{ pickedStartTime | |||
| }}</picker> | |||
| - | |||
| <picker mode="time" start="{{ pickedStartTime }}" disabled="{{ !isShowBtns }}" bindchange='chooseEndTime' | |||
| class="address">{{ pickedEndTime }} | |||
| </picker> | |||
| </view> | |||
| <!-- <view tt:if="{{ !merchantId }}" class="addressPickerFlex"> | |||
| <text>选择可用商户:</text> | |||
| <picker style="display: inline-block;" mode="selector" value="{{index}}" range="{{mallList}}" | |||
| range-key="{{mallList[0].distanceName ? 'distanceName' : 'merchantName'}}" disabled="{{false}}" | |||
| bindchange="setMerchant"> | |||
| <view class="pickerInside"></view> | |||
| 请选择 | |||
| </picker> | |||
| </view> | |||
| <view tt:if="{{ merchantId }}" class="addressPicker"> | |||
| <picker style="display: inline;" mode="selector" value="{{index}}" range="{{mallList}}" | |||
| range-key="{{mallList[0].distanceName ? 'distanceName' : 'merchantName'}}" disabled="{{false}}" | |||
| bindchange="setMerchant"> | |||
| <text tt:if="{{ !reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ | |||
| mallList[currentIndex].merchantName }} <text tt:if="{{ mallList[currentIndex].distance_str }}" | |||
| class="distanceFoot">{{ | |||
| mallList[currentIndex].distance_str }}</text></text></text> | |||
| <text tt:if="{{ reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ reservationMerchantName | |||
| }}</text></text> | |||
| </picker> | |||
| </view> --> | |||
| <view tt:if="{{ !shopItem && !reservationMerchantName }}" class="addressPickerFlex" bindtap="goSelectShop"> | |||
| <text>选择可用商户:</text> | |||
| <view class="pickerInside"> | |||
| 请选择 | |||
| </view> | |||
| </view> | |||
| <view tt:if="{{ shopItem || reservationMerchantName }}" class="addressPicker" bindtap="goSelectShop"> | |||
| <text tt:if="{{ reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ reservationMerchantName | |||
| }}</text></text> | |||
| <text tt:else> 选择可用商户:<text class="pickerInside">{{ | |||
| shopItem.merchantName }} <text tt:if="{{ shopItem.distance_str }}" | |||
| class="distanceFoot">{{shopItem.distance_str }}</text></text></text> | |||
| </view> | |||
| <view class="describeTextarea"> | |||
| <textarea class="describe" placeholder="备注:说点什么吧" disabled="{{ !isShowBtns }}" bindinput="describing" | |||
| value="{{ describeStr }}"></textarea> | |||
| </view> | |||
| <block tt:if="{{isShowBtns}}"> | |||
| <button class="confirm" type="primary" bindtap="confirm">{{ appointmentText }}</button> | |||
| <!-- <button tt:if="{{ id && status != 1}}" type="primary" bindtap="cancel">取消预约</button> --> | |||
| </block> | |||
| </view> | |||