| | |
| | | "pages/specialDiscussion/webView/index", |
| | | "pages/index/bookDetail", |
| | | "pages/index/resourceCover", |
| | | "pages/test/testCover" |
| | | "pages/test/testCover", |
| | | "pages/scanResult/index" |
| | | ], |
| | | "subPackages": [ |
| | | { |
| | |
| | | }) |
| | | } else { |
| | | wx.redirectTo({ |
| | | url: '/pages/index/scanResult/index?result=' + res.result, |
| | | url: '/pages/scanResult/index?result=' + res.result, |
| | | }) |
| | | } |
| | | } |
| | |
| | | // pages/index/scanResult/index.js |
| | | const app = getApp() |
| | | |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | isOther: false, |
| | | activeCodeAndStoreChannelLinks: [], |
| | | activeInfo: null, |
| | | description: "" |
| | | description: "", |
| | | itemType: '', |
| | | goodsData: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | result, |
| | | textValue: result.type == "PromoteCode" ? '领取' : '激活' |
| | | }) |
| | | this.getRules(); |
| | | // this.getRules(); |
| | | this.getProductByCode(); |
| | | } else { |
| | | debugger |
| | | this.setData({ |
| | | isOther: true |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | debugger |
| | | this.setData({ |
| | | isOther: true |
| | | }) |
| | |
| | | showCancel: false, |
| | | success(res) { |
| | | if (res.confirm) { |
| | | setTimeout(() => { |
| | | wx.navigateBack() |
| | | }, 2500); |
| | | wx.navigateBack() |
| | | } |
| | | } |
| | | }) |
| | |
| | | .then(res => { |
| | | try { |
| | | const list = JSON.parse(res.config); |
| | | console.log('code', res, list); |
| | | if (this.data.result) { |
| | | |
| | | const type = res.saleMethodList[0].type |
| | | this.setData({ |
| | | goodsData: res, |
| | | }) |
| | | this.getProductListById(list); |
| | | } |
| | | if (res?.activeCodeAndStoreChannelLinks) { |
| | |
| | | app.MG.store |
| | | .getProductList({ |
| | | queryType: "*", |
| | | subAccess: [{ |
| | | StoreRefCode: app.config.learnPlatformGoodsStore, // 默认商品库 |
| | | Path: "", |
| | | Type: "*", |
| | | }, ], |
| | | // 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: { |
| | |
| | | }) |
| | | .then(res => { |
| | | res.datas.map(item => { |
| | | item.name = item.name + '-' + this.data.goodsData.saleMethodList[0].name |
| | | item.price ? item.price = (item.price).toFixed(2) : ""; |
| | | item.oldPrice ? item.oldPrice = (item.oldPrice).toFixed(2) : ""; |
| | | item.icon ? item.icon = item.icon : item.icon = "/static/images/default-book-img.png", |
| | | item.itemType = this.data.goodsData.saleMethodList[0].type == 'createProductFolderSaleMethod' ? '目录' : this.data.goodsData.saleMethodList[0].type == 'createProductItemSaleMethod' ? '资源' : '电子书' |
| | | }) |
| | | console.log(1, res.datas[0]); |
| | | that.setData({ |
| | | productInfo: res.datas |
| | | }) |
| | |
| | | <!--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="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> |
| | | <text wx:if="{{item.price}}" class="publicCss" |
| | | >价格:<text style="color: red">¥{{ item.price }}</text></text |
| | | > |
| | | <text class="type-box">{{item.itemType}}</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 /> |
| | | <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="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> |
| | | <text class="timer" |
| | | >{{ item.isForAllProduct ? "全场可用" : "仅可购买指定商品" }}</text |
| | | > |
| | | <view class="timer"> |
| | | <text>{{ item.start }}</text> |
| | | <text>~</text> |
| | |
| | | </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 |
| | | class="button-example" |
| | | wx:if="{{productInfo.length > 0 || couponList.length > 0}}" |
| | | > |
| | | <t-button bindtap="useActiveCode" size="large" block |
| | | >{{textValue}}</t-button |
| | | > |
| | | </view> |
| | | <view class="text"> |
| | | <rich-text space="emsp" nodes="{{rules.tourism_content}}" /> |
| | |
| | | </view> |
| | | <view wx:else class="empyt"> |
| | | <t-empty icon="error-circle" description="请扫描正确的二维码" /> |
| | | </view> |
| | | </view> |
| | |
| | | .publicCss { |
| | | font-size: 28rpx; |
| | | padding: 10rpx 0; |
| | | } |
| | | |
| | | .type-box { |
| | | font-size: 28rpx; |
| | | color: #FF6C00; |
| | | background: rgba(255, 108, 0, 0.24); |
| | | padding: 4rpx 8rpx; |
| | | border-radius: 9rpx; |
| | | } |