From 63e49f648d64e62a5c0668a48072c73ed6217290 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 04 十二月 2024 09:45:26 +0800 Subject: [PATCH] saoma --- pages/home/home.js | 14 pages/scanResult/selectPage/index.js | 247 ++++++++++++++ pages/scanResult/index.js | 294 +++++++++++++++++ pages/scanResult/selectPage/index.json | 10 packageDomain/pages/sampleBookList/applicationForm/index.wxss | 29 + pages/scanResult/selectPage/index.wxss | 138 ++++++++ pages/scanResult/index.json | 7 pages/scanResult/selectPage/index.wxml | 70 ++++ pages/scanResult/index.wxss | 136 ++++++++ packageDomain/pages/sampleBookList/applicationForm/index.wxml | 6 pages/scanResult/index.wxml | 45 ++ 11 files changed, 981 insertions(+), 15 deletions(-) diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.wxml b/packageDomain/pages/sampleBookList/applicationForm/index.wxml index 1e56e52..7b74f1a 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.wxml +++ b/packageDomain/pages/sampleBookList/applicationForm/index.wxml @@ -1,3 +1,4 @@ +<view class="container"> <view class="tab"> <t-tabs t-class="t-tabs" @@ -10,9 +11,10 @@ <t-tab-panel label="鐢靛瓙鏍蜂功" value="1" /> </t-tabs> </view> +<view class="content"> <view class="bookListBox"> <view class="tips"> - <rich-text space="emsp" nodes="{{description}}" class="content" /> + <rich-text space="emsp" nodes="{{description}}" /> </view> <view class="bookList"> <view wx:if="{{bookList.length > 0}}"> @@ -135,3 +137,5 @@ > <button class="submit" bindtap="submit">鎻愪氦</button> </view> +</view> +</view> diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.wxss b/packageDomain/pages/sampleBookList/applicationForm/index.wxss index cb79294..b06ffd3 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.wxss +++ b/packageDomain/pages/sampleBookList/applicationForm/index.wxss @@ -1,12 +1,20 @@ page { - overflow-y: auto !important; + /* overflow-y: auto !important; */ position: relative; background-color: #F2F3F8 !important; } .container { + width: 100vw; + height: 100vh; +} + +.content { width: 100%; - height: 100%; + height: calc(100vh - env(safe-area-inset-bottom) - 100rpx); + box-sizing: border-box; + margin-top: 96rpx; + overflow-y: auto !important; } @@ -20,11 +28,6 @@ width: 100%; } -.content { - box-sizing: border-box; - height: calc(100vh - env(safe-area-inset-bottom) - 96rpx); -} - .t-tabs__track { display: none; @@ -35,14 +38,20 @@ position: fixed !important; top: 0; left: 0; - padding-top: 20rpx; + z-index: 10; + margin-top: 20rpx; + /* background-color: #F2F3F8 !important; */ + +} + +.tab-bg { + height: 20rpx; background-color: #F2F3F8 !important; } .t-tabs { background: none !important; width: 100%; - z-index: 1 } .t-tabs__wrapper { @@ -84,7 +93,7 @@ background: #fff; min-height: 200rpx; border-radius: 10rpx; - padding: 180rpx 40rpx 40rpx 40rpx; + padding: 40rpx; } .tips { diff --git a/pages/home/home.js b/pages/home/home.js index 75fef81..4cee2d9 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -648,10 +648,16 @@ success(res) { console.log(res); if (res.errMsg == "scanCode:ok" && res.path || res.result) { - let path = res.path || res.result - wx.redirectTo({ - url: '/' + path, - }) + if (res.path) { + let path = res.path || res.result + wx.redirectTo({ + url: '/' + path, + }) + } else { + wx.redirectTo({ + url: '/pages/index/scanResult/index?result=' + res.result, + }) + } } } }) diff --git a/pages/scanResult/index.js b/pages/scanResult/index.js new file mode 100644 index 0000000..1164b30 --- /dev/null +++ b/pages/scanResult/index.js @@ -0,0 +1,294 @@ +// pages/index/scanResult/index.js +const app = getApp() + +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + textValue: "棰嗗彇", + rules: null, + result: null, + productInfo: [], + couponList: [], + isOther: false, + activeCodeAndStoreChannelLinks: [], + activeInfo: null, + description: "" + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + try { + const result = JSON.parse(options.result) + if (result && result.type) { + this.setData({ + result, + textValue: result.type == "PromoteCode" ? '棰嗗彇' : '婵�娲�' + }) + this.getRules(); + this.getProductByCode(); + } else { + this.setData({ + isOther: true + }) + } + } catch (error) { + this.setData({ + isOther: true + }) + } + }, + + // 婵�娲荤爜瑙勫垯 + getRules() { + let query = { + path: app.config.refCodes.learnPlatform.exchangeRules, + storeInfo: app.config.learnPlatformGoodsStore, + repositoryInfo: app.config.learnPlatformGoodsStore, + paging: { + start: 0, + size: 9999 + }, + fields: { + tourism_content: [] + }, + }; + app.MG.resource.getItem(query).then((res) => { + try { + // const ruleData = res.datas.find(e => e.refCode == 'tourism_exchangeRules') + this.setData({ + rules: this.data.result.type == "ActivationCode" ? res.datas.find(e => e.refCode == 'tourism_activationCodeCollectionRules') : res.datas.find(e => e.refCode == 'tourism_couponCollectionRules') + }) + } catch (error) { + console.log(error) + } + }) + }, + + // 婵�娲荤爜婵�娲� + useActiveCode() { + var that = this; + if (that.data.result && that.data.result.type == "ActivationCode") { + const activeInfo = that.data.activeInfo + const activeCodeAndStoreChannelLinks = that.data.activeCodeAndStoreChannelLinks + if ((!activeInfo || activeInfo.productIds.length == 0) && activeCodeAndStoreChannelLinks.length > 0) { + wx.showModal({ + title: '娓╅Θ鎻愮ず', + content: '璇烽�夋嫨瓒冲鏁伴噺鐨勫彲閫夊晢鍝侊紒', + showCancel: false + }) + return false + } + app.MG.store + .userActiveCode({ + code: that.data.result.code, + cardNum: that.data.result.cardNum, + apiActiveCodeSelectProductRequests: this.data.activeInfo ? [this.data.activeInfo] : [] + }) + .then(res => { + wx.showModal({ + title: '娓╅Θ鎻愮ず', + content: res, + showCancel: false + }) + setTimeout(() => { + wx.navigateTo({ + url: '/pages/codeRecord/index', + }) + }, 2500); + }); + } else { + let that = this; + const data = { + refCodeOrGuids: [that.data.result.guid], + }; + app.MG.store.getPromoteCode(data).then(res => { + let message = ""; + let icon = "successe" + if (res == "-5") { + message = "棰嗗彇澶辫触,浼樻儬鍒稿凡杩囨湡!"; + icon = "fail" + } else if (res == "-7") { + message = "鎶辨瓑锛屼紭鎯犲埜宸茬粡棰嗗彇瀹屾瘯锛�"; + icon = "fail" + } else if (res == "-1") { + message = "棰嗗彇澶辫触,绯荤粺閿欒!"; + icon = "fail" + } else if (res == "-2") { + message = "鎶辨瓑锛屼紭鎯犲埜宸茬粡棰嗗彇瀹屾瘯!"; + icon = "fail" + } else if (res == "-3") { + message = "棰嗗彇澶辫触,浼樻儬鍒告棤鏁�!"; + icon = "fail" + } else if (res == "-4") { + message = "棰嗗彇澶辫触,浼樻儬鍒告棤鏁�!"; + icon = "fail" + } else if (res == "-6") { + message = "棰嗗彇澶辫触,棰嗗彇鐘舵�佸紓甯�!"; + icon = "fail" + } else if (res == "1") { + message = "棰嗗彇鎴愬姛!"; + } + wx.showModal({ + title: '娓╅Θ鎻愮ず', + content: message, + showCancel: false, + success(res) { + if (res.confirm) { + setTimeout(() => { + wx.navigateBack() + }, 2500); + } + } + }) + }); + } + }, + + // 鏍规嵁code鑾峰彇鍟嗗搧淇℃伅 + getProductByCode() { + var that = this; + if (that.data.result && that.data.result.type == "ActivationCode") { + app.MG.store + .getActiveCode({ + code: that.data.result.code, + cardNum: that.data.result.cardNum, + }) + .then(res => { + try { + const list = JSON.parse(res.config); + if (this.data.result) { + this.getProductListById(list); + } + if (res?.activeCodeAndStoreChannelLinks) { + this.setData({ + description: res.description, + activeCodeAndStoreChannelLinks: res.activeCodeAndStoreChannelLinks + }) + } + } catch (error) { + this.setData({ + isOther: true + }) + } + }); + } else { + if (this.data.result != null) { + const data = { + refCodeOrGuids: [that.data.result.guid], + }; + app.MG.store.getPromoteCodeDetail(data).then(res => { + if (res && that.data.result) { + res.map(item => { + if (item.start) { + item.start ? item.start = item.start.split("T")[0] : new Date() + } + if (item.end) { + item.end ? item.end = item.end.split("T")[0] : new Date() + } + }) + this.setData({ + couponList: res + }) + } + }); + } + } + }, + + //鏍规嵁id杩涜澶稿簱鏌ヨ鍟嗗搧 + getProductListById(ids) { + let that = this; + app.MG.store + .getProductList({ + queryType: "*", + subAccess: [{ + StoreRefCode: app.config.learnPlatformGoodsStore, // 榛樿鍟嗗搧搴� + Path: "", + Type: "*", + }, ], + sort: { + CreateDate: "Desc", + }, + fields: { + tourism_author: [], + tourism_paperPrice: [], + tourism_publicationDate: [], + tourism_ISBN: [], + "Id=": ids.map(item => item.id + ""), + }, + paging: { + start: 0, + size: 9999, + }, + coverSize: { + width: 215, + }, + }) + .then(res => { + res.datas.map(item => { + item.price ? item.price = (item.price).toFixed(2) : ""; + item.oldPrice ? item.oldPrice = (item.oldPrice).toFixed(2) : ""; + }) + that.setData({ + productInfo: res.datas + }) + }); + }, + + // 璺宠浆鍒板晢鍝侀�夋嫨椤甸潰 + selectPage(e) { + const { + info + } = e.currentTarget.dataset + wx.navigateTo({ + url: '/pages/scanResult/selectPage/index?info=' + JSON.stringify(info) + '&result=' + JSON.stringify(this.data.result), + }) + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + + }, +}) \ No newline at end of file diff --git a/pages/scanResult/index.json b/pages/scanResult/index.json new file mode 100644 index 0000000..fb4da2e --- /dev/null +++ b/pages/scanResult/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "t-button": "tdesign-miniprogram/button/button", + "t-empty": "tdesign-miniprogram/empty/empty", + "t-cell": "tdesign-miniprogram/cell/cell" + } +} \ No newline at end of file diff --git a/pages/scanResult/index.wxml b/pages/scanResult/index.wxml new file mode 100644 index 0000000..5073613 --- /dev/null +++ b/pages/scanResult/index.wxml @@ -0,0 +1,45 @@ +<!--pages/index/scanResult/index.wxml--> +<view class="content" wx:if="{{!isOther}}"> + <view class="productWall" wx:if="{{productInfo.length > 0}}"> + <view class="product" wx:for="{{productInfo}}" wx:for-item="item" wx:for-index="index" wx:key="index"> + <view class="productImg"> + <image class="icon" src="{{item.icon}}" mode="aspectFit" /> + </view> + <view class="productInfo"> + <text wx:if="{{item.name}}" class="publicCss">{{ item.name }}</text> + <text wx:if="{{item.tourism_ISBN}}" class="publicCss">ISBN锛歿{ item.tourism_ISBN }}</text> + <text wx:if="{{item.tourism_author}}" class="publicCss">浣滆�咃細{{ item.tourism_author }}</text> + <text wx:if="{{item.price}}" class="publicCss">浠锋牸锛�<text style="color:red">锟{ item.price }}</text></text> + </view> + </view> + </view> + <view class="selectCard" wx:if="{{activeCodeAndStoreChannelLinks.length>0}}"> + <t-cell title="{{description?description:'閫夋嫨婵�娲诲晢鍝�'}}" bordered="{{false}}" bindtap="selectPage" description="{{activeInfo && activeInfo.productIds.length>0?'宸查�夋嫨'+ activeInfo.productIds.length +'浠跺晢鍝�':''}}" data-info="{{activeCodeAndStoreChannelLinks}}" arrow /> + </view> + <view class="couponWall" wx:if="{{couponList.length > 0}}"> + <view class="coupon" wx:for="{{couponList}}" wx:for-item="item" wx:for-index="index" wx:key="index"> + <image class="couponIcon" src="/static/images/web/coupon.png" mode="aspectFit" /> + <view class="price">锟{ item.value }}鍏�</view> + <view class="couponInfo"> + <text>{{ item.name }}</text> + <text class="timer">{{ + item.isForAllProduct ? "鍏ㄥ満鍙敤" : "浠呭彲璐拱鎸囧畾鍟嗗搧" + }}</text> + <view class="timer"> + <text>{{ item.start }}</text> + <text>~</text> + <text>{{ item.end }}</text> + </view> + </view> + </view> + </view> + <view class="button-example" wx:if="{{productInfo.length > 0 || couponList.length > 0}}"> + <t-button theme="danger" bindtap="useActiveCode" size="large" block>{{textValue}}</t-button> + </view> + <view class="text"> + <rich-text space="emsp" nodes="{{rules.tourism_content}}" /> + </view> +</view> +<view wx:else class="empyt"> + <t-empty icon="error-circle" description="璇锋壂鎻忔纭殑浜岀淮鐮�" /> +</view> \ No newline at end of file diff --git a/pages/scanResult/index.wxss b/pages/scanResult/index.wxss new file mode 100644 index 0000000..95fd2c3 --- /dev/null +++ b/pages/scanResult/index.wxss @@ -0,0 +1,136 @@ +/* pages/index/scanResult/index.wxss */ +.content { + width: 100vw; + height: calc(100vh - env(safe-area-inset-bottom)); + overflow: auto; +} + +.empyt { + width: 100vw; + height: calc(100vh - env(safe-area-inset-bottom)); + display: flex; + justify-content: center; + align-items: flex-start; + padding-top: 200rpx; + margin: auto; + box-sizing: border-box; +} + +.text { + padding: 10rpx 20rpx; + box-sizing: border-box; + font-size: 28rpx; + line-height: 50rpx; +} + +.button-example { + width: 100%; + padding: 20rpx; + box-sizing: border-box; +} + +.button-example:not(:last-child) { + margin-bottom: 32rpx; +} + + + +.coupon { + width: 650rpx; + height: 180rpx; + margin: auto; + display: flex; + justify-content: flex-start; + align-items: center; + background-color: #f0434304; + margin-bottom: 20px; + position: relative; +} + +.couponIcon { + position: absolute; + left: 0; + top: 0; + width: 650rpx; + height: 180rpx; +} + +.price { + width: 40%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + font-size: 36rpx; + color: #f04343; + border-right: 1px dashed #e95c5cc7; + padding-left: 20rpx; + box-sizing: border-box; +} + +.timer { + font-size: 26rpx; +} + +.couponInfo { + width: 60%; + height: 80%; + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: flex-start; + padding-left: 20rpx; + box-sizing: border-box; + font-size: 30rpx; + color: #f04343; +} + +.couponIcon { + max-width: 100%; + height: 100%; +} + +.productWall, +.couponWall { + max-height: 600rpx; + overflow-y: auto; + padding: 0 12rpx; + box-sizing: border-box; +} + +.productWall { + height: 400rpx; +} + +.selectCard { + border-top: 1rpx solid #eee; + border-bottom: 1rpx solid #eee; +} + +.product { + display: flex; + justify-content: flex-start; + align-items: center; + padding: 20rpx; + box-sizing: border-box; +} + +.icon { + width: 250rpx; + height: 200rpx; + border: 1rpx solid #eee; +} + +.productInfo { + min-height: 200rpx; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + margin-left: 20rpx; +} + +.publicCss { + font-size: 28rpx; + padding: 10rpx 0; +} \ No newline at end of file diff --git a/pages/scanResult/selectPage/index.js b/pages/scanResult/selectPage/index.js new file mode 100644 index 0000000..6469c38 --- /dev/null +++ b/pages/scanResult/selectPage/index.js @@ -0,0 +1,247 @@ +// pages/index/scanResult/selectPage/index.js +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + options: { + styleIsolation: 'apply-shared', + }, + value: [], + optionsData: [], + currentPath: "", + currentResult: null, + selectNum: 0, + allowSelectNum: 0, + storeId: "", + storeChannelId: "", + productIds: [], + // 鍔犺浇鍙傛暟 + triggered: false, + bottomLoading: false, + skeletonLoding: true, + isNoData: false, + + // 杩斿洖椤堕儴 + isBackTop: false, + setScrollValue: 0, + + //鍒嗛〉 + pageSize: 1, + pageLimit: 10, + pageTotalCount: 0, + isMoreData: false + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + if (options && options.info && options.result) { + const info = JSON.parse(options.info) + if (info && info.length > 0) { + const { + store, + storeChannel, + allowSelectProductCount + } = info[0] + this.setData({ + currentPath: store.refCode + "\\" + storeChannel.refCode, + storeId: store.id, + storeChannelId: storeChannel.id, + allowSelectNum: allowSelectProductCount, + currentResult: options.result + }) + this.getProductList() + } + } + }, + + onChange(e) { + const { + value + } = e.detail + const arr = [] + if (value.length > this.data.allowSelectNum) { + return false + } + if (value && value.length) { + for (let index = 0; index < value.length; index++) { + const item = value[index]; + arr.push(this.data.optionsData[item]?.id) + } + } + this.setData({ + productIds: arr, + selectNum: arr.length, + value: value + }); + }, + + activeCode() { + const activeInfo = { + storeId: this.data.storeId, + storeChannelId: this.data.storeChannelId, + productIds: this.data.productIds + } + if (this.data.productIds.length < this.data.allowSelectNum) { + wx.showModal({ + title: '娓╅Θ鎻愮ず', + content: '璇烽�夋嫨瓒冲鏁伴噺鐨勫彲閫夊晢鍝侊紒', + showCancel: false + }) + return false + } + let pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; + prevPage.setData({ + activeInfo + }) + wx.navigateBack({ + delta: 1 + }) + }, + + // 鑾峰彇鍒楄〃 + getProductList(isReachBottom) { + app.MG.store + .getProductList({ + storeInfo: app.config.learnPlatformGoodsStore, + path: this.data.currentPath, + paging: { + start: (this.data.pageSize - 1) * this.data.pageLimit, + size: this.data.pageLimit, + }, + fields: { + tourism_paperPrice: [], + tourism_productDescription: [], + tourism_content: [] + }, + coverSize: { + height: 400 + } + }) + .then(res => { + try { + res.datas.map(item => { + item.price ? item.price = (item.price).toFixed(2) : ""; + item.oldPrice ? item.oldPrice = (item.oldPrice).toFixed(2) : ""; + item.tourism_paperPrice ? item.tourism_paperPrice = (item.tourism_paperPrice).toFixed(2) : ""; + }) + let list = res.datas; + //瑙﹀簳鍔犺浇鏂版暟鎹苟淇濈暀鑰佹暟鎹� + if (isReachBottom) { + list = [...this.data.optionsData, ...list] //灏嗘柊鏁版嵁鍔犲叆鑰佹暟鎹腑 + } + this.setData({ + optionsData: list, + pageTotalCount: res.total, + skeletonLoding: false + }) + } catch (error) { + console.log(error) + } + }); + }, + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + this.setData({ + pageSize: 1, + bottomLoading: false, + isMoreData: false, + isNoData: true + }) + if (this._freshing) return + this._freshing = true; + setTimeout(() => { + this.setData({ + triggered: false, + isNoData: false + }) + this._freshing = false + this.getProductList(); + }, 500) + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + if (this.data.pageTotalCount > this.data.optionsData.length) { + this.setData({ + pageSize: this.data.pageSize + 1, + bottomLoading: true, + isMoreData: false + }) + } else { + setTimeout(() => { + this.setData({ + bottomLoading: false, + isMoreData: true + }) + }, 500) + return false; + } + this.getProductList(true); + }, + + // 鐩戝惉婊氬姩璺濈 + onPageScroll(e) { + if (e.detail.scrollTop >= 1000) { + this.setData({ + isBackTop: true + }) + } else { + this.setData({ + isBackTop: false + }) + } + }, + + // 杩斿洖椤堕儴 + onToTop() { + this.setData({ + setScrollValue: 0 + }) + }, + + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/scanResult/selectPage/index.json b/pages/scanResult/selectPage/index.json new file mode 100644 index 0000000..ba4b98c --- /dev/null +++ b/pages/scanResult/selectPage/index.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", + "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group", + "t-icon": "tdesign-miniprogram/icon/icon", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-back-top": "tdesign-miniprogram/back-top/back-top", + "t-empty": "tdesign-miniprogram/empty/empty" + } +} \ No newline at end of file diff --git a/pages/scanResult/selectPage/index.wxml b/pages/scanResult/selectPage/index.wxml new file mode 100644 index 0000000..fdd8224 --- /dev/null +++ b/pages/scanResult/selectPage/index.wxml @@ -0,0 +1,70 @@ +<!-- <view class="container" wx:if="{{!skeletonLoding}}"> --> +<view class="container"> + <scroll-view scroll-y class="content" style="{{allChecked || isMoreDel?'padding-top: 4vh':''}}" refresher-enabled="{{true}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bind:scroll="onPageScroll" model:scroll-top="{{setScrollValue}}" bindrefresherpulling="{{refresh.onPulling}}" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom"> + <view slot="refresher" class="refresh-container"> + <view class="loading"> + <t-loading theme="circular" size="40rpx" text="姝e湪鍒锋柊..." class="wrapper" /> + </view> + </view> + <view class="pageInfo"> + <t-checkbox-group value="{{value}}" bind:change="onChange"> + <view wx:for="{{optionsData}}" wx:key="index" class="card {{_.contain(value, index) ? 'card--active' : value.indexOf(index)}}"> + <image class="iconStyle" src="{{item.icon}}" mode="aspectFill" /> + <t-icon wx:if="{{_.contain(value, index)}}" name="check" t-class="card__icon" ariaHidden="{{true}}" /> + <t-checkbox value="{{index}}" label="{{item.name}}" content="{{item.description}}" borderless /> + </view> + </t-checkbox-group> + <view wx:if="{{!isNodata && cartList.length == 0}}" class="empyt"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> + </view> + <view class="bottom-loading" wx:if="{{bottomLoading}}"> + <t-loading theme="circular" size="40rpx" text="鍔犺浇涓�..." class="wrapper" /> + </view> + <view class="bottom-loading" style="color: #ccc;font-size: 28rpx;" wx:if="{{isMoreData}}"> + <text>娌℃湁鏇村浜�</text> + </view> + </view> + </scroll-view> + <t-back-top theme="round" wx:if="{{isBackTop}}" class="backTop" text="椤堕儴" bind:to-top="onToTop"></t-back-top> + <view class="select_tabbar"> + <view class="cssPublic"> + <view class="tabItams"> + <text>鏈�澶氬彲閫� : </text> + <text><text style="color: red;">{{allowSelectNum}}</text> 浠�</text> + </view> + <view class="tabItams"> + <text>宸查�� : </text> + <text><text style="color: #0052d9;">{{selectNum}} </text>浠�</text> + </view> + </view> + <view class="activeCode" bindtap="activeCode"> + <text>鍓嶅線婵�娲�</text> + </view> + </view> +</view> + +<!-- 楠ㄦ灦灞� --> +<!-- <import src="./index.skeleton.wxml" /> +<template is="skeleton" wx:if="{{skeletonLoding}}"></template> --> + + +<wxs module="refresh"> + module.exports = { + onPulling: function (evt, instance) { + var p = Math.min(evt.detail.dy / 80, 1) + var view = instance.selectComponent('.refresh-container') + view.setStyle({ + opacity: p, + transform: "scale(" + p + ")" + }) + }, + wxsFunction: function (event, ownerInstance) { + var img = instance.selectComponent('#image') + return img; + }, + } + +</wxs> +<wxs module="_"> + module.exports.contain = function (arr, key) { if (arr && arr.length > 0) return arr.indexOf(key) > -1 } +</wxs> \ No newline at end of file diff --git a/pages/scanResult/selectPage/index.wxss b/pages/scanResult/selectPage/index.wxss new file mode 100644 index 0000000..d84ed8b --- /dev/null +++ b/pages/scanResult/selectPage/index.wxss @@ -0,0 +1,138 @@ +/* pages/index/scanResult/selectPage/index.wxss */ +.container { + width: 100vw; + height: 100%; + position: relative; +} + + +.refresh-container { + display: block; + width: 100vw; +} + +.loading { + display: block; + width: 100%; + height: 180rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.bottom-loading { + width: 100vw; + display: flex; + justify-content: center; + align-items: center; + height: 100rpx; +} + +.content { + height: calc(100vh - env(safe-area-inset-bottom) - 100rpx); + box-sizing: border-box; +} + +.empyt { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + padding: 20rpx; + margin: auto; + box-sizing: border-box; +} + +.oldPrice { + text-decoration: line-through; + font-size: 20rpx; + color: #999; +} + +.price { + color: red !important; +} + +.freePrice { + color: rgb(49, 231, 43) !important; + font-size: 26rpx; +} + +.card { + position: relative; + margin: 32rpx; + border-radius: 12rpx; + overflow: hidden; + box-sizing: border-box; + border: 3rpx solid #eee; +} + +.card--active { + border-color: #0052d9; +} + +.card--active::after { + content: ''; + display: block; + position: absolute; + left: 0; + top: 0; + width: 0; + border: 14px solid #0052d9; + border-bottom-color: transparent; + border-right-color: transparent; +} + +.card__icon { + color: #fff; + position: absolute; + left: 1.5px; + top: 1.5px; + z-index: 1; +} + +.iconStyle { + width: 100%; +} + +.select_tabbar { + width: 100vw; + height: 100rpx; + background-color: #fff; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 24rpx; + position: fixed; + left: 0; + bottom: 0; + padding-bottom: env(safe-area-inset-bottom); + border-top: 1rpx solid #eee; +} + +.select_tabbar .cssPublic { + display: flex; + justify-content: space-between; + align-items: center; +} + +.select_tabbar .tabItams { + font-size: 28rpx; + margin-left: 30rpx; +} + +.select_tabbar .activeCode { + display: flex; + align-items: center; + justify-content: center; + width: 200rpx; + height: 100rpx; + background-color: #d54941; + color: #fff; + font-size: 28rpx; +} + +.t-back-top--fixed { + bottom: 15vh !important; +} \ No newline at end of file -- Gitblit v1.9.1