Commit bdac99ba by 王志慧

commit

1 parent 20c77e95
...@@ -23,7 +23,6 @@ class UsersApi { ...@@ -23,7 +23,6 @@ class UsersApi {
true true
) )
} catch (error) { } catch (error) {
console.log(error)
return Promise.reject() return Promise.reject()
} }
} }
......
...@@ -73,7 +73,6 @@ const loginSuccess = () => { ...@@ -73,7 +73,6 @@ const loginSuccess = () => {
targetPath targetPath
} }
} = wx.$router.getPageInstance() } = wx.$router.getPageInstance()
console.log(targetPath)
if (targetPath) { if (targetPath) {
const { const {
url, url,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="num" wx:if="{{proDetail.mediaType != '1'}}">{{proDetail.view}}</view> <view class="num" wx:if="{{proDetail.mediaType != '1'}}">{{proDetail.view}}</view>
</view> </view>
</view> </view>
<view class="tab-wrap calc-wrap"> <view class="tab-wrap calc-wrap" wx:if="{{proetail.detailList}}">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}"> <van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab wx:for="{{proDetail.detailList}}" title="{{item.name}}" wx:key="idnex" /> <van-tab wx:for="{{proDetail.detailList}}" title="{{item.name}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" /> <!-- <van-tab title="合作案例" />
......
...@@ -104,7 +104,6 @@ Page({ ...@@ -104,7 +104,6 @@ Page({
// this.shareQuery = `sceneCode=${sceneObj.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}` // this.shareQuery = `sceneCode=${sceneObj.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}`
this.shareQuery = `id=${id}&sceneCode=${sceneCode}&productCode=${proData?.productCode}&isShare=${true}&sharephone=${sharephone}` this.shareQuery = `id=${id}&sceneCode=${sceneCode}&productCode=${proData?.productCode}&isShare=${true}&sharephone=${sharephone}`
console.log(this.shareQuery, 'onload----')
this.shareAppMessage = { this.shareAppMessage = {
title:this.shareTitle, title:this.shareTitle,
path: `/${this.route}?${this.shareQuery}`, path: `/${this.route}?${this.shareQuery}`,
...@@ -160,7 +159,6 @@ Page({ ...@@ -160,7 +159,6 @@ Page({
// this.shareQuery = `sceneCode=${sceneObj?.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}` // this.shareQuery = `sceneCode=${sceneObj?.sceneCode}&productCode=${proInfo?.productCode}&isShare=${true}&productDesc=${proInfo?.productName}&category=${proInfo?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${phone}`
this.shareQuery = `id=${id}&sceneCode=${sceneCode}&productCode=${proData?.productCode}&isShare=${true}&sharephone=${phone}` this.shareQuery = `id=${id}&sceneCode=${sceneCode}&productCode=${proData?.productCode}&isShare=${true}&sharephone=${phone}`
console.log(this.shareQuery, 'onrouter----')
this.shareAppMessage = { this.shareAppMessage = {
title:this.shareTitle, title:this.shareTitle,
path: `/${this.route}?${this.shareQuery}`, path: `/${this.route}?${this.shareQuery}`,
...@@ -173,7 +171,6 @@ Page({ ...@@ -173,7 +171,6 @@ Page({
return new Promise((resolve) => { return new Promise((resolve) => {
let _data; let _data;
BusassistantApi.getDiscoverDetail({id}).then((res) => { BusassistantApi.getDiscoverDetail({id}).then((res) => {
console.log(res);
_data = res.data; _data = res.data;
resolve(_data); resolve(_data);
}); });
......
...@@ -97,7 +97,6 @@ Page({ ...@@ -97,7 +97,6 @@ Page({
}, },
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
async onRoute(options) { async onRoute(options) {
console.log(options);
if (!options || utils.isEmptyObj(options) || options.isShare) return if (!options || utils.isEmptyObj(options) || options.isShare) return
// let { scenIndex, videoList, index, leftMenuIndex = 0 } = options // let { scenIndex, videoList, index, leftMenuIndex = 0 } = options
// options.videoIndex = index // options.videoIndex = index
...@@ -134,7 +133,6 @@ Page({ ...@@ -134,7 +133,6 @@ Page({
BusassistantApi.getDetailWithLike({ BusassistantApi.getDetailWithLike({
id id
}).then((res) => { }).then((res) => {
console.log(res);
_data = res.data; _data = res.data;
resolve(_data); resolve(_data);
}); });
......
...@@ -3,14 +3,20 @@ const navStyle = "background-color: transparent;"; ...@@ -3,14 +3,20 @@ const navStyle = "background-color: transparent;";
// import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData' // import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData'
// import {scenceList} from "./constant/data" // import {scenceList} from "./constant/data"
import ActivityApi from "~/api/activityApi/index"; import ActivityApi from "~/api/activityApi/index";
import {getActivityRecord} from '~/api/viewprod' import {
import { IMG_VERSION } from "~/utils/constantData"; getActivityRecord
import { imgUrlMixin } from "~/mixins/index"; } from '~/api/viewprod'
import {
IMG_VERSION
} from "~/utils/constantData";
import {
imgUrlMixin
} from "~/mixins/index";
const IMG_URL = wx.$imgUrl; const IMG_URL = wx.$imgUrl;
let leftMenuIndex = 0 let leftMenuIndex = 0
Component({ Component({
properties:{ properties: {
myTabIdx:Number myTabIdx: Number
}, },
behaviors: [imgUrlMixin], behaviors: [imgUrlMixin],
data: { data: {
...@@ -35,37 +41,43 @@ Component({ ...@@ -35,37 +41,43 @@ Component({
methods: { methods: {
// 产品点击事件 // 产品点击事件
proClick(e) { proClick(e) {
console.log(e.detail)
//登录的用户手机号 //登录的用户手机号
let userInfo = wx.$storage.get("userInfo"); let userInfo = wx.$storage.get("userInfo");
const { info, sceneCode } = e.detail const {
info,
sceneCode
} = e.detail
let obj = { let obj = {
phone: userInfo.phone, phone: userInfo.phone,
id:info.id, id: info.id,
sceneCode sceneCode
} }
wx.$router.go('/packagesList/packageDiscovery/pages/productDetail/productDetail', obj) wx.$router.go('/packagesList/packageDiscovery/pages/productDetail/productDetail', obj)
}, },
sysMenuClick(e) { sysMenuClick(e) {
console.log(e); const {
const { id } = e.detail; id
} = e.detail;
leftMenuIndex = id; leftMenuIndex = id;
}, },
// 视频点击事件 // 视频点击事件
videoClick(e) { videoClick(e) {
let userInfo = wx.$storage.get("userInfo") let userInfo = wx.$storage.get("userInfo")
const { info, sceneCode } = e.detail const {
info,
sceneCode
} = e.detail
const obj = { const obj = {
phone: userInfo.phone, phone: userInfo.phone,
id:info.id, id: info.id,
} }
wx.$router.go('/packagesList/packageDiscovery/pages/videoDetail/videoDetail', obj) wx.$router.go('/packagesList/packageDiscovery/pages/videoDetail/videoDetail', obj)
}, },
leftClick(e) { leftClick(e) {
console.log(e.detail,999) const {
console.log(this.data.resScenceList) sceneid
const { sceneid } = e.detail } = e.detail
const idx = this.data.resScenceList?.findIndex(item => item.sceneid == sceneid) || 0 const idx = this.data.resScenceList?.findIndex(item => item.sceneid == sceneid) || 0
this.setData({ this.setData({
curTabId: sceneid, curTabId: sceneid,
...@@ -79,27 +91,37 @@ Component({ ...@@ -79,27 +91,37 @@ Component({
// }) // })
// 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 2-没有配置 1-有配置 // 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 2-没有配置 1-有配置
if (!e.detail.sceneCode || e.detail.isBannerLink != 1) return if (!e.detail.sceneCode || e.detail.isBannerLink != 1) return
const { hasPhoneNumber } = this.data const {
hasPhoneNumber
} = this.data
// 获取场景 // 获取场景
let systemItem = this.data.systemData.find(item => item.sceneCode == e.detail.sceneCode) let systemItem = this.data.systemData.find(item => item.sceneCode == e.detail.sceneCode)
let productItem = this.data.productData.find(item => item.sceneCode == e.detail.sceneCode) let productItem = this.data.productData.find(item => item.sceneCode == e.detail.sceneCode)
const id = systemItem?.productList[0].id || productItem?.productList[0].id const id = systemItem?.productList[0].id || productItem?.productList[0].id
if (!id) return if (!id) return
console.log(123456) wx.$router.go('/packagesList/packageDiscovery/pages/productDetail/productDetail', {
wx.$router.go('/packagesList/packageDiscovery/pages/scenarioDetail/scenarioDetail', { hasPhoneNumber, id, sceneCode: e.detail.sceneCode }) hasPhoneNumber,
id,
sceneCode: e.detail.sceneCode
})
}, },
activityClick(e) { activityClick(e) {
const id = e.detail const id = e.detail
wx.$router.go( wx.$router.go(
"/packagesList/packageDiscovery/pages/activityDetail/activityDetail", "/packagesList/packageDiscovery/pages/activityDetail/activityDetail", {
{id} id
}
); );
}, },
// 获取全部活动列表 // 获取全部活动列表
getActivityRecord() { getActivityRecord() {
getActivityRecord({}).then(({data, code, message}) => { getActivityRecord({}).then(({
data,
code,
message
}) => {
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
...@@ -114,34 +136,26 @@ Component({ ...@@ -114,34 +136,26 @@ Component({
}, },
changeMyTab(e) { changeMyTab(e) {
const {id} = e.currentTarget.dataset const {
id
} = e.currentTarget.dataset
this.setData({ this.setData({
myTabIdx: id myTabIdx: id
}); });
}, },
onLoad(option) { onLoad(option) {
const app = getApp()
app.getBaseData().then(res => {
const productData = res[0].list
const systemData = res[1].list
this.getSceneData(productData)
this.setData({
[`navList[0]`]: res[0].name,
[`navList[1]`]: res[1].name,
systemData
})
})
// this.setData({ // this.setData({
// tabIndex: option?.tabIndex || 0 // tabIndex: option?.tabIndex || 0
// }) // })
this.getActivityRecord() this.getActivityRecord()
}, },
emitUserInfo(options){ emitUserInfo(options) {
console.log(options)
}, },
getSceneData(list) { getSceneData(list) {
console.log(list, 'list') const {
const { merchantId } = wx.$storage.get("userInfo"); merchantId
} = wx.$storage.get("userInfo");
wx.showLoading({ wx.showLoading({
title: "加载中...", title: "加载中...",
}); });
...@@ -151,7 +165,7 @@ Component({ ...@@ -151,7 +165,7 @@ Component({
.then((res) => { .then((res) => {
wx.hideLoading(); wx.hideLoading();
let productData = [] let productData = []
if(res.code==21){ if (res.code == 21) {
wx.$router.reLaunch('/packageStoreAssistant/packageAuth/pages/authentication/login/login') wx.$router.reLaunch('/packageStoreAssistant/packageAuth/pages/authentication/login/login')
return; return;
} }
...@@ -181,22 +195,18 @@ Component({ ...@@ -181,22 +195,18 @@ Component({
// ] // ]
// } // }
let openList = [] let openList = []
res.data.forEach(item =>{ res.data.forEach(item => {
if(item.status==1){ if (item.status == 1) {
openList.push(item.sceneCode) openList.push(item.sceneCode)
} }
}) })
console.log(openList,'openList')
productData = list.filter(item => openList.includes(item.sceneCode)) productData = list.filter(item => openList.includes(item.sceneCode))
console.log(productData)
} }
this.setData({ this.setData({
showPage: true, showPage: true,
productData, productData,
curTabId: productData?.[this.data.curTabIdx]?.sceneid || 0 curTabId: productData?.[this.data.curTabIdx]?.sceneid || 0
},()=>{ }, () => {});
console.log(productData,'productData111')
});
}) })
.catch((err) => { .catch((err) => {
this.setData({ this.setData({
...@@ -205,7 +215,9 @@ Component({ ...@@ -205,7 +215,9 @@ Component({
}); });
}, },
navbarReady(e) { navbarReady(e) {
let { height } = e.detail; let {
height
} = e.detail;
this.setData({ this.setData({
headerHeight: height, headerHeight: height,
}); });
...@@ -216,7 +228,9 @@ Component({ ...@@ -216,7 +228,9 @@ Component({
// this.setData({ // this.setData({
// navStyle: scrollTop == 0 ? navStyle : `background-color:${color};` // navStyle: scrollTop == 0 ? navStyle : `background-color:${color};`
// }) // })
wx.$eventbus.emit("evt_page_scroll", { scrollTop }); wx.$eventbus.emit("evt_page_scroll", {
scrollTop
});
}, },
changeSwiper(e) { changeSwiper(e) {
...@@ -228,11 +242,11 @@ Component({ ...@@ -228,11 +242,11 @@ Component({
// 跳转咨询页面 // 跳转咨询页面
goConsult() { goConsult() {
wx.openCustomerServiceChat({ wx.openCustomerServiceChat({
extInfo: { url: "https://work.weixin.qq.com/kfid/kfcf7b721472201345e" }, extInfo: {
corpId: "ww047bdc0f1e76cc13", url: "https://work.weixin.qq.com/kfid/kfcf7b721472201345e"
complete: (r) => {
console.log(r);
}, },
corpId: "ww047bdc0f1e76cc13",
complete: (r) => {},
}); });
}, },
...@@ -254,4 +268,20 @@ Component({ ...@@ -254,4 +268,20 @@ Component({
isFullSucreen: wx.$api.isFullSucreen(), isFullSucreen: wx.$api.isFullSucreen(),
}); });
}, },
pageLifetimes: {
show() {
const app = getApp()
app.getBaseData().then(res => {
const productData = res[0].list
const systemData = res[1].list
this.getSceneData(productData)
this.setData({
['navList[0]']: res[0].name,
['navList[1]']: res[1].name,
systemData
})
})
}
}
}); });
\ No newline at end of file \ No newline at end of file
...@@ -75,7 +75,6 @@ Page({ ...@@ -75,7 +75,6 @@ Page({
// 重新刷新 // 重新刷新
// let { detail } = e || null // let { detail } = e || null
// console.log(detail) // console.log(detail)
console.log(e)
if (e) { if (e) {
this.setUserInfo() this.setUserInfo()
let clientModule = this.selectComponent('#client') let clientModule = this.selectComponent('#client')
...@@ -85,7 +84,7 @@ Page({ ...@@ -85,7 +84,7 @@ Page({
// merchantModule.init && merchantModule.init() // merchantModule.init && merchantModule.init()
} }
let { isSuper, userInfo } = this.data let { isSuper, userInfo } = this.data
console.log(isSuper)
// 判断是超管才需要切换账号 // 判断是超管才需要切换账号
if (isSuper) { if (isSuper) {
USERAPI.adminSelectLogin() USERAPI.adminSelectLogin()
...@@ -101,7 +100,6 @@ Page({ ...@@ -101,7 +100,6 @@ Page({
item.act = true item.act = true
} }
}) })
console.log(subIndex)
this.setData({ this.setData({
merchantRange, merchantRange,
subIndex subIndex
...@@ -110,7 +108,6 @@ Page({ ...@@ -110,7 +108,6 @@ Page({
.catch(err => { }) .catch(err => { })
} else { } else {
let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }] let merchantRange = [{ merchantId: userInfo.subLoginUser.merchantId, merchantName: userInfo.subLoginUser.merchantName }]
console.log('merchantRange', merchantRange)
this.setData({ this.setData({
merchantRange, merchantRange,
subIndex: 0 subIndex: 0
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
} }
}, },
"setting": { "setting": {
"urlCheck": false "urlCheck": true
}, },
"projectname": "store-assistant-assemble" "projectname": "store-assistant-assemble"
} }
\ No newline at end of file \ No newline at end of file
...@@ -23,12 +23,10 @@ class Request { ...@@ -23,12 +23,10 @@ class Request {
let projectName = params.apiProjectName || this.getRopProject(params.method) let projectName = params.apiProjectName || this.getRopProject(params.method)
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
let path = pathEnum[projectName] let path = pathEnum[projectName]
console.log(path,11)
if (!path) { if (!path) {
path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/` path = requestPath == 'dj' ? `/rop-dj-${projectName}/` : `/rop-scrm-${projectName}/`
} }
params = this.getData(params, requestPath) params = this.getData(params, requestPath)
console.log(domain,requestPath,9)
wx.request({ wx.request({
url: `${domain[requestPath]}${path}router?method=${params.method}`, url: `${domain[requestPath]}${path}router?method=${params.method}`,
data: params, data: params,
...@@ -63,7 +61,6 @@ class Request { ...@@ -63,7 +61,6 @@ class Request {
if (code == '0') { if (code == '0') {
resolve(data.data) resolve(data.data)
} else { } else {
// console.trace(data)
wx.showToast({ wx.showToast({
title: message || '网络请求失败', title: message || '网络请求失败',
icon: 'none' icon: 'none'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!