优化Net
This commit is contained in:
parent
d6526fde86
commit
fb54447a91
9
app.json
9
app.json
@ -25,7 +25,8 @@
|
|||||||
"pages/copyright/refund/refund",
|
"pages/copyright/refund/refund",
|
||||||
"pages/copyright/repair/repair",
|
"pages/copyright/repair/repair",
|
||||||
"pages/copyright/applyRepair/applyRepair",
|
"pages/copyright/applyRepair/applyRepair",
|
||||||
"pages/copyright/applyRefund/applyRefund"
|
"pages/copyright/applyRefund/applyRefund",
|
||||||
|
"pages/shop/market"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
@ -42,6 +43,12 @@
|
|||||||
"iconPath": "/static/images/ic_home_normal.png",
|
"iconPath": "/static/images/ic_home_normal.png",
|
||||||
"selectedIconPath": "/static/images/ic_home_select.png"
|
"selectedIconPath": "/static/images/ic_home_select.png"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/shop/market",
|
||||||
|
"text": "软著市场",
|
||||||
|
"iconPath": "/static/images/ic_home_normal.png",
|
||||||
|
"selectedIconPath": "/static/images/ic_home_select.png"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/mine/mineIndex/mine",
|
"pagePath": "pages/mine/mineIndex/mine",
|
||||||
"text": "我的",
|
"text": "我的",
|
||||||
|
@ -2,6 +2,7 @@ import {
|
|||||||
request
|
request
|
||||||
} from "../http";
|
} from "../http";
|
||||||
const Cache = require('../../utils/storage');
|
const Cache = require('../../utils/storage');
|
||||||
|
const projectName = "plug"
|
||||||
// 公共API
|
// 公共API
|
||||||
const apiPath = {
|
const apiPath = {
|
||||||
mineInvoiceOrderList: '/api/invoicerecharge/recharge-listpage/{userId}/{status}', //可以开具发票的订单
|
mineInvoiceOrderList: '/api/invoicerecharge/recharge-listpage/{userId}/{status}', //可以开具发票的订单
|
||||||
@ -21,7 +22,7 @@ class InvoiceApi {
|
|||||||
static doGetMineInvoiceOrderList(data, status) {
|
static doGetMineInvoiceOrderList(data, status) {
|
||||||
const userId = Cache.get('userId')
|
const userId = Cache.get('userId')
|
||||||
const path = apiPath.mineInvoiceOrderList.replace('{userId}', userId).replace('{status}', status)
|
const path = apiPath.mineInvoiceOrderList.replace('{userId}', userId).replace('{status}', status)
|
||||||
return request(path, "GET", data, null, 'plug')
|
return request(path, "GET", data, projectName)
|
||||||
}
|
}
|
||||||
static doGetDicListByPId(id) {
|
static doGetDicListByPId(id) {
|
||||||
const path = apiPath.dicByPId.replace('{pId}', id)
|
const path = apiPath.dicByPId.replace('{pId}', id)
|
||||||
@ -31,45 +32,45 @@ class InvoiceApi {
|
|||||||
static doGetMineInvoiceList(data) {
|
static doGetMineInvoiceList(data) {
|
||||||
const userId = Cache.get('userId')
|
const userId = Cache.get('userId')
|
||||||
const path = apiPath.mineInvoiceList.replace('{userId}', userId)
|
const path = apiPath.mineInvoiceList.replace('{userId}', userId)
|
||||||
return request(path, "GET", data, null, 'plug')
|
return request(path, "GET", data, projectName)
|
||||||
}
|
}
|
||||||
//保存我的开票信息
|
//保存我的开票信息
|
||||||
static doSaveMineInvoiceInfo(data) {
|
static doSaveMineInvoiceInfo(data) {
|
||||||
const userId = Cache.get('userId')
|
const userId = Cache.get('userId')
|
||||||
const path = apiPath.saveInvoiceInfo.replace('{userId}', userId)
|
const path = apiPath.saveInvoiceInfo.replace('{userId}', userId)
|
||||||
return request(path, "POST", data, null, 'plug')
|
return request(path, "POST", data, projectName)
|
||||||
}
|
}
|
||||||
//编辑开票信息
|
//编辑开票信息
|
||||||
static doUpdateMineInvoiceInfo(id, data) {
|
static doUpdateMineInvoiceInfo(id, data) {
|
||||||
const path = apiPath.updateInvoiceInfo.replace('{invoiceId}', id)
|
const path = apiPath.updateInvoiceInfo.replace('{invoiceId}', id)
|
||||||
return request(path, "PUT", data, null, 'plug')
|
return request(path, "PUT", data, projectName)
|
||||||
}
|
}
|
||||||
//删除开票信息
|
//删除开票信息
|
||||||
static doDelMineInvoiceInfo(id) {
|
static doDelMineInvoiceInfo(id) {
|
||||||
const path = apiPath.deleteInvoiceInfo.replace('{ids}', id)
|
const path = apiPath.deleteInvoiceInfo.replace('{ids}', id)
|
||||||
return request(path, "DELETE", null, null, 'plug')
|
return request(path, "DELETE", null, projectName)
|
||||||
}
|
}
|
||||||
//开票申请列表
|
//开票申请列表
|
||||||
static doGetInvoiceRecordList(data) {
|
static doGetInvoiceRecordList(data) {
|
||||||
const userId = Cache.get('userId')
|
const userId = Cache.get('userId')
|
||||||
const path = apiPath.mineInvoiceRecordList.replace('{userId}', userId)
|
const path = apiPath.mineInvoiceRecordList.replace('{userId}', userId)
|
||||||
return request(path, "GET", data, null, 'plug')
|
return request(path, "GET", data, projectName)
|
||||||
}
|
}
|
||||||
//取消开票申请
|
//取消开票申请
|
||||||
static doCancelInvoiceRecord(id) {
|
static doCancelInvoiceRecord(id) {
|
||||||
const path = apiPath.cancelInvoiceRecord.replace('{invoiceRechargeId}', id)
|
const path = apiPath.cancelInvoiceRecord.replace('{invoiceRechargeId}', id)
|
||||||
return request(path, "PUT", null, null, 'plug')
|
return request(path, "PUT", null, projectName)
|
||||||
}
|
}
|
||||||
//提交开票申请
|
//提交开票申请
|
||||||
static doSaveInvoiceRecord(data) {
|
static doSaveInvoiceRecord(data) {
|
||||||
const userId = Cache.get('userId')
|
const userId = Cache.get('userId')
|
||||||
const path = apiPath.saveInvoiceRecord.replace('{userId}', userId)
|
const path = apiPath.saveInvoiceRecord.replace('{userId}', userId)
|
||||||
return request(path, "POST", data, null, 'plug')
|
return request(path, "POST", data, projectName)
|
||||||
}
|
}
|
||||||
//修改开票申请
|
//修改开票申请
|
||||||
static doUpdateInvoiceRecord(id, data) {
|
static doUpdateInvoiceRecord(id, data) {
|
||||||
const path = apiPath.updateInvoiceRecord.replace('{invoiceRechargeId}', id)
|
const path = apiPath.updateInvoiceRecord.replace('{invoiceRechargeId}', id)
|
||||||
return request(path, 'PUT', data, null, 'plug')
|
return request(path, 'PUT', data, projectName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class PayService {
|
|||||||
}
|
}
|
||||||
//获取微信支付参数
|
//获取微信支付参数
|
||||||
static doGetWxPayParams(data) {
|
static doGetWxPayParams(data) {
|
||||||
return request(apiPath.wxPayParams, "POST", data, null, "operator")
|
return request(apiPath.wxPayParams, "POST", data, "operator")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class ProjectService {
|
|||||||
//获取使用规则数据
|
//获取使用规则数据
|
||||||
static doGetRuleDate(id) {
|
static doGetRuleDate(id) {
|
||||||
const path = apiPath.ruleData.replace('{id}', id)
|
const path = apiPath.ruleData.replace('{id}', id)
|
||||||
return request(path, "GET", null, null, "operator", false)
|
return request(path, "GET", null, "operator", false)
|
||||||
}
|
}
|
||||||
static doGetInvestDetail(data) {
|
static doGetInvestDetail(data) {
|
||||||
return request(apiPath.investDetail, "GET", data)
|
return request(apiPath.investDetail, "GET", data)
|
||||||
|
57
net/api/shop.js
Normal file
57
net/api/shop.js
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import {
|
||||||
|
request
|
||||||
|
} from "../http";
|
||||||
|
// 公共API
|
||||||
|
const proName = 'aiShop'
|
||||||
|
const apiPath = {
|
||||||
|
indexList: "/api/goodsonline/listpage", //上架的软著商品列表 GET
|
||||||
|
saveGoods: "/api/goods/save", //新增软著商品 POST
|
||||||
|
goodsDetail: "/api/goods/get/{goodsId}", //商品详情 GET
|
||||||
|
delGoods: "/api/goods/remove/{ids}", //删除商品 DELETE
|
||||||
|
updateGoods: "/api/goods/update/{goodsId}", //修改商品 PUT
|
||||||
|
doCheck: "/api/goods/sub-check/{goodsId}", //提交审核 PUT
|
||||||
|
onGoods: "/api/goods/publish/{goodsId}", //上架商品 PUT
|
||||||
|
offGoods: "/api/goods/no-publish/{goodsId}", //下架商品 PUT
|
||||||
|
}
|
||||||
|
class Shop {
|
||||||
|
//获取上架的软著列表
|
||||||
|
static doGetIndexList(data) {
|
||||||
|
return request(apiPath.indexList, "GET", data, proName)
|
||||||
|
}
|
||||||
|
//新增软件商品
|
||||||
|
static doSaveGoods(data) {
|
||||||
|
return request(apiPath.saveGoods, "POST", data, proName)
|
||||||
|
}
|
||||||
|
//商品详情
|
||||||
|
static doGetGoodsDetail(id) {
|
||||||
|
const path = apiPath.goodsDetail.replace('{goodsId}', id)
|
||||||
|
return request(path, "GET", null, proName)
|
||||||
|
}
|
||||||
|
//删除商品
|
||||||
|
static doDelGoods(id) {
|
||||||
|
const path = apiPath.delGoods.replace('{goodsId}', id)
|
||||||
|
return request(path, "DELETE", null, proName)
|
||||||
|
}
|
||||||
|
//更新商品
|
||||||
|
static doUpdateGoods(id, data) {
|
||||||
|
const path = apiPath.updateGoods.replace('{goodsId}', id)
|
||||||
|
return request(path, "PUT", data, proName)
|
||||||
|
}
|
||||||
|
//提交审核
|
||||||
|
static doSubCheck(id) {
|
||||||
|
const path = apiPath.doCheck.replace('{goodsId}', id)
|
||||||
|
return request(path, "PUT", null, proName)
|
||||||
|
}
|
||||||
|
//上架商品
|
||||||
|
static doOnGoods(id) {
|
||||||
|
const path = apiPath.onGoods.replace('{goodsId}', id)
|
||||||
|
return request(path, "PUT", null, proName)
|
||||||
|
}
|
||||||
|
//下架商品
|
||||||
|
static doOffGoods(id) {
|
||||||
|
const path = apiPath.offGoods.replace('{goodsId}', id)
|
||||||
|
return request(path, "PUT", null, proName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Shop;
|
@ -26,13 +26,13 @@ const apiPath = {
|
|||||||
}
|
}
|
||||||
class UserService {
|
class UserService {
|
||||||
static doLogin(data) {
|
static doLogin(data) {
|
||||||
return request(apiPath.loginUrl, "POST", data, null, 'operator', false)
|
return request(apiPath.loginUrl, "POST", data, 'operator', false)
|
||||||
}
|
}
|
||||||
static doRegister(data) {
|
static doRegister(data) {
|
||||||
return request(apiPath.registerUrl, "POST", data, null, 'operator', false)
|
return request(apiPath.registerUrl, "POST", data, 'operator', false)
|
||||||
}
|
}
|
||||||
static doUnbindWx() {
|
static doUnbindWx() {
|
||||||
return request(apiPath.unbindWx, "GET", null, null, 'operator', true)
|
return request(apiPath.unbindWx, "GET", null, 'operator', true)
|
||||||
}
|
}
|
||||||
static doUpdateUserInfo(data) {
|
static doUpdateUserInfo(data) {
|
||||||
return request(apiPath.updateUserInfo, "PUT", data)
|
return request(apiPath.updateUserInfo, "PUT", data)
|
||||||
|
66
net/http.js
66
net/http.js
@ -5,10 +5,18 @@ import {
|
|||||||
uploadImgUrl,
|
uploadImgUrl,
|
||||||
previewUrl,
|
previewUrl,
|
||||||
copyrightUrl,
|
copyrightUrl,
|
||||||
|
aiShopUrl,
|
||||||
imgAssets,
|
imgAssets,
|
||||||
appUrl
|
appUrl
|
||||||
} from '../net/mainUrl'
|
} from '../net/mainUrl'
|
||||||
|
// 项目与基础URL映射关系
|
||||||
|
const PROJECT_URL_MAP = {
|
||||||
|
operator: operatorUrl,
|
||||||
|
copyright: copyrightUrl,
|
||||||
|
plug: operatorPlug,
|
||||||
|
aiShop: aiShopUrl,
|
||||||
|
// 添加新项目只需在此扩展
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* 传入请求参数,返回Promise支持链试调用
|
* 传入请求参数,返回Promise支持链试调用
|
||||||
* @param url 请求地址
|
* @param url 请求地址
|
||||||
@ -16,56 +24,42 @@ import {
|
|||||||
* @param data 请求体数据
|
* @param data 请求体数据
|
||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
*/
|
*/
|
||||||
function request(url, method = "GET", data = {}, params = {}, project = "copyright", needToken = true) {
|
function request(url, method = "GET", data = {}, project = "copyright", needToken = true) {
|
||||||
const header = {
|
// 1. 参数预处理
|
||||||
"content-type": "application/json"
|
const baseUrl = PROJECT_URL_MAP[project] || copyrightUrl;
|
||||||
// 有其他content-type需求加点逻辑判断处理即可
|
const requestUrl = baseUrl + url;
|
||||||
}
|
// 2. 请求头配置
|
||||||
//是否需要token
|
const headers = {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
};
|
||||||
|
|
||||||
if (needToken) {
|
if (needToken) {
|
||||||
const token = Cache.get('token')
|
const token = Cache.get('token');
|
||||||
if (token) {
|
if (token) {
|
||||||
header.Auth = `Bearer ${token}`;
|
headers.Auth = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断项目
|
// 3. 请求配置
|
||||||
var baseUrl = operatorUrl
|
const requestConfig = {
|
||||||
if (project == 'operator') {
|
url: requestUrl.toString(),
|
||||||
baseUrl = operatorUrl
|
method: method.toUpperCase(),
|
||||||
} else if (project == 'copyright') {
|
data,
|
||||||
baseUrl = copyrightUrl
|
header: headers,
|
||||||
} else if (project == 'plug') {
|
timeout: 10000,
|
||||||
baseUrl = operatorPlug
|
dataType: "json"
|
||||||
}
|
};
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
wx.request({
|
wx.request({
|
||||||
url: baseUrl + url,
|
...requestConfig,
|
||||||
timeout: 8000,
|
|
||||||
method,
|
|
||||||
data,
|
|
||||||
dataType: "json", // 微信官方文档中介绍会对数据进行一次JSON.parse
|
|
||||||
header,
|
|
||||||
success(res) {
|
success(res) {
|
||||||
// wx.hideLoading();
|
|
||||||
// HTTP状态码为200才视为成功
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
// 真正的数据响应体中还有一层success字段判断业务状态,按实际情况处理
|
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
// if (res.data.success) {
|
|
||||||
// resolve(res.data.result)
|
|
||||||
// } else {
|
|
||||||
// // 业务判断错误
|
|
||||||
// reject(res)
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
console.log('错误success')
|
console.log('错误success')
|
||||||
// wx.request的特性,只要有响应就会走success回调,所以在这里判断状态,非200的均视为请求失败
|
|
||||||
reject(res.data)
|
reject(res.data)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
// wx.hideLoading();
|
|
||||||
// 断网、服务器挂了都会fail回调,直接reject即可
|
|
||||||
console.log('错误')
|
console.log('错误')
|
||||||
if (err.data) {
|
if (err.data) {
|
||||||
reject(err.data)
|
reject(err.data)
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// 定义api服务地址
|
// 定义api服务地址
|
||||||
const operatorUrl = 'https://www.aimzhu.com/operator';
|
const operatorUrl = 'https://www.aimzhu.com/operator'
|
||||||
const operatorPlug = 'https://www.aimzhu.com/operator-plugin'
|
const operatorPlug = 'https://www.aimzhu.com/operator-plugin'
|
||||||
const copyrightUrl = 'https://www.aimzhu.com/copyright';
|
const copyrightUrl = 'https://www.aimzhu.com/copyright'
|
||||||
|
const aiShopUrl = 'https://www.aimzhu.com/aishop'
|
||||||
const uploadImgUrl = copyrightUrl + '/api/file/v2/upload-image'
|
const uploadImgUrl = copyrightUrl + '/api/file/v2/upload-image'
|
||||||
const previewUrl = copyrightUrl + '/route/file/v2/download/true/'
|
const previewUrl = copyrightUrl + '/route/file/v2/download/true/'
|
||||||
const imgAssets = 'https://www.aimzhu.com/miniapp-assets'
|
const imgAssets = 'https://www.aimzhu.com/miniapp-assets'
|
||||||
@ -13,6 +14,7 @@ export {
|
|||||||
uploadImgUrl,
|
uploadImgUrl,
|
||||||
previewUrl,
|
previewUrl,
|
||||||
copyrightUrl,
|
copyrightUrl,
|
||||||
|
aiShopUrl,
|
||||||
imgAssets,
|
imgAssets,
|
||||||
appUrl
|
appUrl
|
||||||
}
|
}
|
@ -7,6 +7,7 @@ import {
|
|||||||
} from '../../net/http'
|
} from '../../net/http'
|
||||||
const Cache = require('../../utils/storage')
|
const Cache = require('../../utils/storage')
|
||||||
const Utils = require('../../utils/util')
|
const Utils = require('../../utils/util')
|
||||||
|
const data =require('../../utils/data')
|
||||||
const app = getApp()
|
const app = getApp()
|
||||||
const deviceInfo = wx.getDeviceInfo()
|
const deviceInfo = wx.getDeviceInfo()
|
||||||
const screenInfo = wx.getWindowInfo();
|
const screenInfo = wx.getWindowInfo();
|
||||||
@ -87,23 +88,7 @@ Page({
|
|||||||
showAd: false, //显示优惠卷广告
|
showAd: false, //显示优惠卷广告
|
||||||
tempCoupons: [], //优惠卷
|
tempCoupons: [], //优惠卷
|
||||||
isNoShowToday: false, //今日不再显示
|
isNoShowToday: false, //今日不再显示
|
||||||
tabList: [{
|
tabList: data.tabList,
|
||||||
"pagePath": "pages/index/index",
|
|
||||||
"text": "首页",
|
|
||||||
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
|
|
||||||
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
|
|
||||||
"selected": true,
|
|
||||||
"hasMsg": false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/mine/mineIndex/mine",
|
|
||||||
"text": "我的",
|
|
||||||
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
|
|
||||||
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
|
|
||||||
"selected": false,
|
|
||||||
"hasMsg": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
const _self = this
|
const _self = this
|
||||||
@ -615,7 +600,7 @@ Page({
|
|||||||
})
|
})
|
||||||
const requests = _self.data.tempCoupons.map(item => {
|
const requests = _self.data.tempCoupons.map(item => {
|
||||||
const coupons = {
|
const coupons = {
|
||||||
couponId: _self.data.tempCoupons.couponId
|
couponId: item.couponId
|
||||||
}
|
}
|
||||||
return UserApi.doSaveCoupons(coupons)
|
return UserApi.doSaveCoupons(coupons)
|
||||||
})
|
})
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
// pages/mine/mine.js
|
// pages/mine/mine.js
|
||||||
import UserApi from '../../../net/api/userApi'
|
import UserApi from '../../../net/api/userApi'
|
||||||
import ProApi from '../../../net/api/projectApi'
|
import ProApi from '../../../net/api/projectApi'
|
||||||
import {
|
|
||||||
copyrightUrl
|
|
||||||
} from '../../../net/http'
|
|
||||||
const Utils = require('../../../utils/util')
|
const Utils = require('../../../utils/util')
|
||||||
|
const data = require('../../../utils/data')
|
||||||
const app = getApp()
|
const app = getApp()
|
||||||
const deviceInfo = wx.getDeviceInfo()
|
const deviceInfo = wx.getDeviceInfo()
|
||||||
const screenInfo = wx.getWindowInfo();
|
const screenInfo = wx.getWindowInfo();
|
||||||
@ -33,47 +31,7 @@ Page({
|
|||||||
allCount: 0,
|
allCount: 0,
|
||||||
materialCount: 0,
|
materialCount: 0,
|
||||||
accountInfo: {},
|
accountInfo: {},
|
||||||
menuList: [{
|
menuList: data.mineMenuList,
|
||||||
icon: "ic-user",
|
|
||||||
title: "个人信息",
|
|
||||||
path: "/pages/mine/mineAccount/mineInfo/mineInfo"
|
|
||||||
}, {
|
|
||||||
icon: 'ic-msg',
|
|
||||||
title: '消息通知',
|
|
||||||
path: '/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice'
|
|
||||||
}, {
|
|
||||||
icon: 'ic-refund',
|
|
||||||
title: '退款项目',
|
|
||||||
path: '/pages/copyright/refund/refund'
|
|
||||||
}, {
|
|
||||||
icon: 'ic-repair',
|
|
||||||
title: '补正项目',
|
|
||||||
path: '/pages/copyright/repair/repair'
|
|
||||||
}, {
|
|
||||||
icon: 'ic-invoice-info',
|
|
||||||
title: '发票抬头',
|
|
||||||
path: '/pages/mine/mineAccount/invoiceInfo/invoiceInfo'
|
|
||||||
}, {
|
|
||||||
icon: "ic-pay-record",
|
|
||||||
title: "资金流水",
|
|
||||||
path: "/pages/mine/mineAccount/minePayRecord/minePayRecord"
|
|
||||||
}, {
|
|
||||||
icon: "ic-order",
|
|
||||||
title: "我的订单",
|
|
||||||
path: "/pages/mine/mineAccount/mineOrder/mineOrder"
|
|
||||||
}, {
|
|
||||||
icon: "ic-invoice",
|
|
||||||
title: "发票管理",
|
|
||||||
path: "/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage"
|
|
||||||
}, {
|
|
||||||
icon: "ic-contact",
|
|
||||||
title: "产权联系人",
|
|
||||||
path: "/pages/mine/mineAccount/mineContact/mineContact"
|
|
||||||
}, {
|
|
||||||
icon: "ic-unbind",
|
|
||||||
title: "微信解绑",
|
|
||||||
path: ""
|
|
||||||
}],
|
|
||||||
buttons: [{
|
buttons: [{
|
||||||
text: '知道了'
|
text: '知道了'
|
||||||
}],
|
}],
|
||||||
@ -83,23 +41,7 @@ Page({
|
|||||||
errorHint: '',
|
errorHint: '',
|
||||||
animationData: {}, //刷新动画
|
animationData: {}, //刷新动画
|
||||||
animation: null,
|
animation: null,
|
||||||
tabList: [{
|
tabList: data.tabList,
|
||||||
"pagePath": "pages/index/index",
|
|
||||||
"text": "首页",
|
|
||||||
"iconPath": app.globalData.localAssets + "/ic_home_normal.png",
|
|
||||||
"selectedIconPath": app.globalData.localAssets + "/ic_home_select.png",
|
|
||||||
"selected": false,
|
|
||||||
"hasMsg": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/mine/mineIndex/mine",
|
|
||||||
"text": "我的",
|
|
||||||
"iconPath": app.globalData.localAssets + "/ic_mine_normal.png",
|
|
||||||
"selectedIconPath": app.globalData.localAssets + "/ic_mine_select.png",
|
|
||||||
"selected": true,
|
|
||||||
"hasMsg": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
allPrice: 0, //全托管价格
|
allPrice: 0, //全托管价格
|
||||||
materialPrice: 0, //写材料价格
|
materialPrice: 0, //写材料价格
|
||||||
urgent: 0, //加急价格
|
urgent: 0, //加急价格
|
||||||
|
35
pages/shop/market.js
Normal file
35
pages/shop/market.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// pages/shop/market.js
|
||||||
|
const data= require('../../utils/data')
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
tabList:data.tabList
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
console.log('页面显示')
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const currentPage = pages[pages.length - 1];
|
||||||
|
const tabList = this.data.tabList;
|
||||||
|
tabList.forEach(item => {
|
||||||
|
item.selected = item.pagePath === currentPage.route;
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
tabList
|
||||||
|
});
|
||||||
|
},
|
||||||
|
})
|
5
pages/shop/market.json
Normal file
5
pages/shop/market.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"custom-tabbar": "/components/tabbar/custom-tabbar"
|
||||||
|
}
|
||||||
|
}
|
4
pages/shop/market.wxml
Normal file
4
pages/shop/market.wxml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<view>
|
||||||
|
市场
|
||||||
|
</view>
|
||||||
|
<custom-tabbar tabList="{{tabList}}" color="var(--tabbar-normal-color)" selectedColor="var(--tabbar-select-color)"></custom-tabbar>
|
1
pages/shop/market.wxss
Normal file
1
pages/shop/market.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/shop/market.wxss */
|
@ -28,8 +28,76 @@ const stateList = [{
|
|||||||
"title": "已取消",
|
"title": "已取消",
|
||||||
"value": "CANCELED"
|
"value": "CANCELED"
|
||||||
}]
|
}]
|
||||||
|
const tabList = [{
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"text": "首页",
|
||||||
|
"iconPath": "/static/images/ic_home_normal.png",
|
||||||
|
"selectedIconPath": "/static/images/ic_home_select.png",
|
||||||
|
"selected": false,
|
||||||
|
"hasMsg": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/shop/market",
|
||||||
|
"text": "软著市场",
|
||||||
|
"iconPath": "/static/images/ic_home_normal.png",
|
||||||
|
"selectedIconPath": "/static/images/ic_home_select.png",
|
||||||
|
"selected": false,
|
||||||
|
"hasMsg": false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/mine/mineIndex/mine",
|
||||||
|
"text": "我的",
|
||||||
|
"iconPath": "/static/images/ic_mine_normal.png",
|
||||||
|
"selectedIconPath": "/static/images/ic_mine_select.png",
|
||||||
|
"selected": false,
|
||||||
|
"hasMsg": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const mineMenuList = [{
|
||||||
|
"icon": "ic-user",
|
||||||
|
"title": "个人信息",
|
||||||
|
"path": "/pages/mine/mineAccount/mineInfo/mineInfo"
|
||||||
|
}, {
|
||||||
|
"icon": 'ic-msg',
|
||||||
|
"title": '消息通知',
|
||||||
|
"path": '/pages/mine/mineAccount/mineMsgNotice/mineMsgNotice'
|
||||||
|
}, {
|
||||||
|
"icon": 'ic-refund',
|
||||||
|
"title": '退款项目',
|
||||||
|
"path": '/pages/copyright/refund/refund'
|
||||||
|
}, {
|
||||||
|
"icon": 'ic-repair',
|
||||||
|
"title": '补正项目',
|
||||||
|
"path": '/pages/copyright/repair/repair'
|
||||||
|
}, {
|
||||||
|
"icon": 'ic-invoice-info',
|
||||||
|
"title": '发票抬头',
|
||||||
|
"path": '/pages/mine/mineAccount/invoiceInfo/invoiceInfo'
|
||||||
|
}, {
|
||||||
|
"icon": "ic-pay-record",
|
||||||
|
"title": "资金流水",
|
||||||
|
"path": "/pages/mine/mineAccount/minePayRecord/minePayRecord"
|
||||||
|
}, {
|
||||||
|
"icon": "ic-order",
|
||||||
|
"title": "我的订单",
|
||||||
|
"path": "/pages/mine/mineAccount/mineOrder/mineOrder"
|
||||||
|
}, {
|
||||||
|
"icon": "ic-invoice",
|
||||||
|
"title": "发票管理",
|
||||||
|
"path": "/pages/mine/mineAccount/mineInvoiceManage/mineInvoiceManage"
|
||||||
|
}, {
|
||||||
|
"icon": "ic-contact",
|
||||||
|
"title": "产权联系人",
|
||||||
|
"path": "/pages/mine/mineAccount/mineContact/mineContact"
|
||||||
|
}, {
|
||||||
|
"icon": "ic-unbind",
|
||||||
|
"title": "微信解绑",
|
||||||
|
"path": ""
|
||||||
|
}]
|
||||||
module.exports = {
|
module.exports = {
|
||||||
stateList,
|
stateList,
|
||||||
kindList,
|
kindList,
|
||||||
typeList
|
typeList,
|
||||||
|
tabList,
|
||||||
|
mineMenuList
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user