| | |
| | | import { Request } from './utils/http' |
| | | import { updateManager } from './utils/appExtends' |
| | | import {webSocket, socketReconnect} from './utils/websocket' |
| | | // let livePlayer = requirePlugin('live-player-plugin'); |
| | | let livePlayer = requirePlugin('live-player-plugin'); |
| | | // promisify all wx‘s api |
| | | promisifyAll(); |
| | | |
| | |
| | | }, |
| | | |
| | | appOnLoad(){ |
| | | console.log('开始发送setting请求'); |
| | | |
| | | this.getSettings().then((res) => { |
| | | |
| | |
| | | this.globalData.isAllowSelectDeliveryMethod = res.data.isAllowSelectDeliveryMethod||false; |
| | | this.globalData.deliveryMethod = res.data.deliveryMethod||''; |
| | | this.globalData.isShowBannerPhotoOnHomePageForLiveUser = res.data.isShowBannerPhotoOnHomePageForLiveUser||false; |
| | | this.globalData.isShowMatGroupInHomePage = res.data.isShowMatGroupInHomePage||false; |
| | | |
| | | resolve(res); |
| | | }, |
| | |
| | | // 直播间 |
| | | if((options.scene == 1007 || options.scene == 1008 || options.scene == 1044)&&options.path.includes('/pages/live-player-plugin')){ |
| | | console.log('通过直播分享卡片进入小程序', options); |
| | | // livePlayer.getShareParams() |
| | | // .then((res)=>{ |
| | | // console.log('获取直播 room id', res.room_id); // 房间号 |
| | | // console.log('获取直播 openid', res.openid); // 用户openid |
| | | // console.log('获取直播 share openid', res.share_openid); // 分享者openid,分享卡片进入场景才有 |
| | | // console.log('获取 custom params', res.custom_params); // 开发者在跳转进入直播间页面时,页面路径上携带的自定义参数,这里传回给开发者 |
| | | // let FromUserId = res.custom_params.FromUserId || ''; |
| | | // this.handleFromUserIdChange(FromUserId); |
| | | // }).catch(err => { |
| | | // console.log('获取直播 share params', err) |
| | | // }) |
| | | livePlayer.getShareParams() |
| | | .then((res)=>{ |
| | | console.log('获取直播 room id', res.room_id); // 房间号 |
| | | console.log('获取直播 openid', res.openid); // 用户openid |
| | | console.log('获取直播 share openid', res.share_openid); // 分享者openid,分享卡片进入场景才有 |
| | | console.log('获取 custom params', res.custom_params); // 开发者在跳转进入直播间页面时,页面路径上携带的自定义参数,这里传回给开发者 |
| | | let FromUserId = res.custom_params.FromUserId || ''; |
| | | this.handleFromUserIdChange(FromUserId); |
| | | }).catch(err => { |
| | | console.log('获取直播 share params', err) |
| | | }) |
| | | } |
| | | // 不是初次打开 |
| | | else if(!this.isFirstOpenApp){ |
| | |
| | | } |
| | | }, |
| | | "plugins": { |
| | | |
| | | "live-player-plugin": { |
| | | "version": "1.2.2", |
| | | "provider": "wx2b03c6e691cd7370" |
| | | }, |
| | | "chooseLocation": { |
| | | "version": "1.0.5", |
| | | "provider": "wx76a9a06e5b4e693e" |
| | |
| | | let posterCreate = this.selectComponent('#posterCreate'); |
| | | posterCreate.formSubmit(e); |
| | | }, |
| | | |
| | | compressImg(img){ |
| | | // let img = this.data.goodsItemImg; |
| | | let lastIndex = img.lastIndexOf('.'); |
| | | let ext = img.substring(lastIndex); |
| | | let noext = img.slice(0,lastIndex); |
| | | return noext.split('_')[0]+'_360x360'+ext |
| | | }, |
| | | downloadFile(){ |
| | | console.log(app.globalData.cardUserData) |
| | | console.log('头像',app.globalData.cardUserData.Avatar) |
| | | // console.log('logo',app.globalData.logoUrl) |
| | | console.log('二维码',this.data.qrCode) |
| | | console.log('商品',this.data.goodsItemImg) |
| | | console.log('商品',this.compressImg(this.data.goodsItemImg)) |
| | | let avatarUrl = wx.pro.downloadFile({ |
| | | url: app.globalData.cardUserData.Avatar |
| | | }).then((res)=>{ |
| | |
| | | } |
| | | }) |
| | | let goodsImg = wx.pro.downloadFile({ |
| | | url: this.data.goodsItemImg |
| | | url: this.compressImg(this.data.goodsItemImg) |
| | | }).then((res)=>{ |
| | | if (res.statusCode === 200) { |
| | | // imgDownloadSum++; |
| | |
| | | {
|
| | | "extEnable": true,
|
| | | "extAppid": "wx50edcb45ab6bfb06",
|
| | | "extAppid": "wxec78156626302b78",
|
| | | "directCommit": false,
|
| | | "ext": {
|
| | | "name": "wechat",
|
| | | "AppId": "wx50edcb45ab6bfb06",
|
| | | "AppId": "wxec78156626302b78",
|
| | | "HttpHost": "https://mp.onbus.cn",
|
| | | "WssHost": "wss://mp.onbus.cn",
|
| | | "FooterNumPosition":3,
|
| | |
| | | let edit = this.data.goodsList.edit; |
| | | let num = res.data.CartItems || 0; |
| | | if (app.globalData.cartIndex>-1||app.globalData.cartIndex<6) { |
| | | try { |
| | | wx.setTabBarBadge({ |
| | | index: app.globalData.cartIndex, |
| | | text: num.toString() |
| | | }) |
| | | } catch (error) { |
| | | console.log(error); |
| | | |
| | | } |
| | | } |
| | | let isAllSelect = false; |
| | | let isNoSelect = false; |
| | |
| | | |
| | | async addCartItem(event) { |
| | | const matcode = event.currentTarget.dataset.matcode; |
| | | let [err, res] = await this.addCartItemRequest(matcode); |
| | | const mininum = event.currentTarget.dataset.mininum; |
| | | |
| | | let [err, res] = await this.addCartItemRequest(matcode,mininum); |
| | | if (err) { |
| | | return; |
| | | } |
| | |
| | | this.updateCartList(res); |
| | | // this.updateGoodsList(); |
| | | }, |
| | | async addCartItemRequest(matcode) { |
| | | async addCartItemRequest(matcode,mininum) { |
| | | let [err, res] = await utils.to( |
| | | wx.$http.request({ |
| | | url: "/shopping/cart.do", |
| | | data: { |
| | | m: "add", |
| | | matcode, |
| | | quantity: 1, |
| | | quantity: mininum||1, |
| | | }, |
| | | title:'正在加载' |
| | | }) |
| | |
| | | console.log(event); |
| | | const cartId = event.currentTarget.dataset.id; |
| | | let quantity = event.currentTarget.dataset.quantity; |
| | | quantity--; |
| | | let mininum = event.currentTarget.dataset.mininum; |
| | | quantity=quantity-mininum; |
| | | if (quantity <= 0) { |
| | | let [err, res] = await this.deleteCartItem(cartId); |
| | | if (err) { |
| | |
| | | console.log(event); |
| | | const cartId = event.currentTarget.dataset.id; |
| | | let quantity = event.currentTarget.dataset.quantity; |
| | | quantity++; |
| | | let mininum = event.currentTarget.dataset.mininum; |
| | | quantity=quantity+mininum; |
| | | if (cartId) { |
| | | await this.sendCartItemChange(cartId, quantity); |
| | | } else { |
| | |
| | | <text class="iconfont icon-sousuo1 search-icon"></text> |
| | | </navigator> |
| | | </van-nav-bar> --> |
| | | <import src="../template/no-more/no-more-template" /> |
| | | <view class="search-bar"> |
| | | <navigator class="search-box" url="../search/search"> |
| | | <view class="search-input"> |
| | |
| | | button-size="26" |
| | | min="0" |
| | | integer |
| | | data-mininum="{{item.Mininum||1}}" |
| | | value="{{ item.selectedQuantity }}" |
| | | async-change |
| | | bind:plus="onCartItemPlus" |
| | |
| | | <!-- <van-tag class="van-tags" mark type="{{tagTypes[item.LiveStatus]}}">{{liveStatus[item.LiveStatus]}}</van-tag>--> |
| | | </block> |
| | | <c-empty wx:if="{{goodsList.length<1}}" desc="该分类下没有商品"></c-empty> |
| | | <template wx:if="{{currentPage>=TotalPages}}" is="noMoreTemplate" /> |
| | | </view> |
| | | |
| | | |
| | |
| | | input-width="50" |
| | | button-size="25" |
| | | min="0" |
| | | data-mininum="{{item.Mininum||1}}" |
| | | integer |
| | | value="{{ item.Quantity }}" |
| | | async-change |
| | |
| | | console.log('。。。首页获取的openid与fromuserid',app.globalData.openID,!app.globalData.openID,app.globalData.FromUserId,!app.globalData.FromUserId) |
| | | if (!app.globalData.openID || !app.globalData.FromUserId) { |
| | | app.globalData.indexCallback = (res) => { |
| | | console.log('首页获取setting'); |
| | | |
| | | that.getSetting(); |
| | | that.getIndexData(); |
| | | this.setData({ |
| | |
| | | that.setData({ |
| | | navList: [], |
| | | }) |
| | | |
| | | |
| | | console.log('开始发送图标菜单请求。。。。',that.data.navList, utils.getUrl('/shopping/getHomePageSubMenu.do')) |
| | | |
| | | // 图标菜单 |
| | |
| | | |
| | | }); |
| | | |
| | | |
| | | console.log('app.globalData.isShowMatGroupInHomePage',app.globalData.isShowMatGroupInHomePage); |
| | | if (app.globalData.isShowMatGroupInHomePage) { |
| | | // 请求下拉菜单 |
| | | wx.request({ |
| | | url: utils.getUrl('/shopping/getMatGroupInHomePage.do'), |
| | |
| | | // wx.hideLoading(); |
| | | // } |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 首次推荐商品请求 |
| | | console.log('开始推荐商品请求。。',utils.getUrl('/shopping/getMatCodeList.do?fromdata=8')) |
| | |
| | | var doccode = ""; |
| | | var rowid = ""; |
| | | var mIndex = ""; |
| | | let formid = ''; |
| | | |
| | | Page({ |
| | | |
| | |
| | | }) |
| | | }, |
| | | |
| | | // inputChange:function(e){ |
| | | // var length = e.detail.value.length; |
| | | // this.setData({ |
| | | // inputLength:length |
| | | // }) |
| | | // }, |
| | | inputChange:function(e){ |
| | | let explain = e.detail.value; |
| | | this.setData({ |
| | | explain |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | // 提交按钮 |
| | | submitForm:function(e){ |
| | | let reasonid = e.detail.value.why; |
| | | let hdmemo = e.detail.value.explain; |
| | | let reasonid = this.data.index; |
| | | // let reasonid = e.detail.value.why; |
| | | let hdmemo = this.data.explain; |
| | | |
| | | var that = this; |
| | | var imageList = this.data.imageList; |
| | | console.log(e.detail.value); |
| | | if (e.detail.value.why == null || e.detail.value.why == ""){ |
| | | if (reasonid == null || reasonid == ""){ |
| | | utils.showTopTips(this,"请选择退款理由"); |
| | | return false; |
| | | } |
| | |
| | | // price:sumPrice |
| | | // }) |
| | | |
| | | console.log(options); |
| | | |
| | | |
| | | wx.request({ |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <form bindsubmit="submitForm"> |
| | | <form > |
| | | <picker class="order-picker " bindchange="bindPickerChange" name="why" value="{{reason[index].ReasonId}}" range="{{reason}}" range-key="ReasonName"> |
| | | <view class="order-row " > |
| | | <view class="order-row-left">退款理由</view> |
| | |
| | | <view class="weui-cells weui-cells_after-title"> |
| | | <view class="weui-cell"> |
| | | <view class="weui-cell__bd"> |
| | | <textarea class="weui-textarea" placeholder="请输入退款说明(选填)" maxlength="200" name="explain" style="height: 200rpx" bindinput="inputChange" /> |
| | | <view class="weui-textarea-counter">{{inputLength||0}}/200</view> |
| | | <textarea class="weui-textarea" placeholder="请输入退款说明(选填)" maxlength="200" name="explain" style="height: 200rpx" bindblur="inputChange" /> |
| | | <!-- <view class="weui-textarea-counter">{{inputLength||0}}/200</view>--> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | </view> --> |
| | | |
| | | <button type="primary" class="savebtn" formType="submit">提交</button> |
| | | <button type="primary" class="savebtn" bindtap="submitForm">提交</button> |
| | | </form> |
| | | |
| | | </view> |
| | |
| | | "disablePlugins": [], |
| | | "outputPath": "" |
| | | }, |
| | | "enableEngineNative": false, |
| | | "useIsolateContext": true, |
| | | "useCompilerModule": true, |
| | | "userConfirmedUseCompilerModuleSwitch": false, |
| | | "packNpmManually": false, |
| | | "packNpmRelationList": [] |
| | | "packNpmRelationList": [], |
| | | "minifyWXSS": true |
| | | }, |
| | | "compileType": "miniprogram", |
| | | "libVersion": "2.13.1", |
| | | "appid": "wxec78156626302b78", |
| | | "projectname": "ShoppingApp2", |
| | | "projectname": "ShoppingMiniApp", |
| | | "isGameTourist": false, |
| | | "simulatorType": "wechat", |
| | | "simulatorPluginLibVersion": {}, |
| | |
| | | "scene": null |
| | | }, |
| | | { |
| | | "id": 19, |
| | | "name": "pages/refund/refund", |
| | | "name": "退款", |
| | | "pathName": "pages/refund/refund", |
| | | "query": "id=WXD200320002&&rowid=003RRAX&&index=0", |
| | | "query": "id=WXD200320002&rowid=003RRAX&index=0&formid=120230", |
| | | "scene": null |
| | | }, |
| | | { |