chore: add .gitignore and remove build outputs
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
unpackage/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
node_modules/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.swp
|
||||||
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"appUser.js","sources":["api/appUser.js"],"sourcesContent":["import { request, authRequest } from '../utils/request'\n\nexport function wechatLogin(code, invite_code) {\n const data = invite_code ? { code, invite_code } : { code }\n return request({ url: '/api/app/users/weixin/login', method: 'POST', data })\n}\n\nexport function bindPhone(user_id, code, extraHeader = {}) {\n return authRequest({ url: `/api/app/users/${user_id}/phone/bind`, method: 'POST', data: { code }, header: extraHeader })\n}\n\nexport function getUserStats(user_id) {\n return authRequest({ url: `/api/app/users/${user_id}/stats`, method: 'GET' })\n}\n\nexport function getPointsBalance(user_id) {\n return authRequest({ url: `/api/app/users/${user_id}/points/balance`, method: 'GET' })\n}\n\nexport function getPointsRecords(user_id, page = 1, page_size = 20) {\n return authRequest({ url: `/api/app/users/${user_id}/points`, method: 'GET', data: { page, page_size } })\n}\n\nexport function getOrders(user_id, status, page = 1, page_size = 20) {\n const data = { page, page_size }\n if (status) data.status = status\n return authRequest({ url: `/api/app/users/${user_id}/orders`, method: 'GET', data })\n}\n\nexport function listAddresses(user_id) {\n return authRequest({ url: `/api/app/users/${user_id}/addresses`, method: 'GET' })\n}\n\nexport function addAddress(user_id, payload) {\n return authRequest({ url: `/api/app/users/${user_id}/addresses`, method: 'POST', data: payload })\n}\n\nexport function updateAddress(user_id, address_id, payload) {\n return authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}`, method: 'PUT', data: payload })\n}\n\nexport function deleteAddress(user_id, address_id) {\n return authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}`, method: 'DELETE' })\n}\n\nexport function setDefaultAddress(user_id, address_id) {\n return authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}/default`, method: 'PUT' })\n}\n\nexport function getActivityDetail(activity_id) {\n return authRequest({ url: `/api/app/activities/${activity_id}`, method: 'GET' })\n}\n\nexport function getActivityIssues(activity_id) {\n return authRequest({ url: `/api/app/activities/${activity_id}/issues`, method: 'GET' })\n}\n\nexport function getActivityIssueRewards(activity_id, issue_id) {\n return authRequest({ url: `/api/app/activities/${activity_id}/issues/${issue_id}/rewards`, method: 'GET' })\n}"],"names":["request","authRequest"],"mappings":";;AAEO,SAAS,YAAY,MAAM,aAAa;AAC7C,QAAM,OAAO,cAAc,EAAE,MAAM,YAAW,IAAK,EAAE,KAAM;AAC3D,SAAOA,cAAAA,QAAQ,EAAE,KAAK,+BAA+B,QAAQ,QAAQ,MAAM;AAC7E;AAEO,SAAS,UAAU,SAAS,MAAM,cAAc,CAAA,GAAI;AACzD,SAAOC,cAAAA,YAAY,EAAE,KAAK,kBAAkB,OAAO,eAAe,QAAQ,QAAQ,MAAM,EAAE,KAAM,GAAE,QAAQ,YAAW,CAAE;AACzH;AAEO,SAAS,aAAa,SAAS;AACpC,SAAOA,cAAW,YAAC,EAAE,KAAK,kBAAkB,OAAO,UAAU,QAAQ,OAAO;AAC9E;AAEO,SAAS,iBAAiB,SAAS;AACxC,SAAOA,cAAW,YAAC,EAAE,KAAK,kBAAkB,OAAO,mBAAmB,QAAQ,OAAO;AACvF;AAEO,SAAS,iBAAiB,SAAS,OAAO,GAAG,YAAY,IAAI;AAClE,SAAOA,cAAW,YAAC,EAAE,KAAK,kBAAkB,OAAO,WAAW,QAAQ,OAAO,MAAM,EAAE,MAAM,UAAW,EAAA,CAAE;AAC1G;AAEO,SAAS,UAAU,SAAS,QAAQ,OAAO,GAAG,YAAY,IAAI;AACnE,QAAM,OAAO,EAAE,MAAM,UAAW;AAChC,MAAI;AAAQ,SAAK,SAAS;AAC1B,SAAOA,0BAAY,EAAE,KAAK,kBAAkB,OAAO,WAAW,QAAQ,OAAO,MAAM;AACrF;AAEO,SAAS,cAAc,SAAS;AACrC,SAAOA,cAAW,YAAC,EAAE,KAAK,kBAAkB,OAAO,cAAc,QAAQ,OAAO;AAClF;AAEO,SAAS,WAAW,SAAS,SAAS;AAC3C,SAAOA,0BAAY,EAAE,KAAK,kBAAkB,OAAO,cAAc,QAAQ,QAAQ,MAAM,QAAO,CAAE;AAClG;AAEO,SAAS,cAAc,SAAS,YAAY,SAAS;AAC1D,SAAOA,cAAW,YAAC,EAAE,KAAK,kBAAkB,OAAO,cAAc,UAAU,IAAI,QAAQ,OAAO,MAAM,QAAO,CAAE;AAC/G;AAEO,SAAS,cAAc,SAAS,YAAY;AACjD,SAAOA,0BAAY,EAAE,KAAK,kBAAkB,OAAO,cAAc,UAAU,IAAI,QAAQ,SAAQ,CAAE;AACnG;AAEO,SAAS,kBAAkB,SAAS,YAAY;AACrD,SAAOA,0BAAY,EAAE,KAAK,kBAAkB,OAAO,cAAc,UAAU,YAAY,QAAQ,MAAK,CAAE;AACxG;AAEO,SAAS,kBAAkB,aAAa;AAC7C,SAAOA,cAAW,YAAC,EAAE,KAAK,uBAAuB,WAAW,IAAI,QAAQ,OAAO;AACjF;AAEO,SAAS,kBAAkB,aAAa;AAC7C,SAAOA,cAAW,YAAC,EAAE,KAAK,uBAAuB,WAAW,WAAW,QAAQ,OAAO;AACxF;AAEO,SAAS,wBAAwB,aAAa,UAAU;AAC7D,SAAOA,0BAAY,EAAE,KAAK,uBAAuB,WAAW,WAAW,QAAQ,YAAY,QAAQ,MAAK,CAAE;AAC5G;;;;;;;;;;;;;;;"}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n</style>\n","import App from './App'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;;;;;;;;;;;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"assets.js","sources":["static/logo.png"],"sourcesContent":["export default \"__VITE_ASSET__46719607__\""],"names":[],"mappings":";AAAA,MAAe,aAAA;;"}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sources":["pages/cabinet/index.vue","../../迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvY2FiaW5ldC9pbmRleC52dWU"],"sourcesContent":["<template>\n <view class=\"wrap\">货柜</view>\n</template>\n\n<script setup>\nimport { onShow } from '@dcloudio/uni-app'\nonShow(() => {\n const token = uni.getStorageSync('token')\n const phoneBound = !!uni.getStorageSync('phone_bound')\n console.log('cabinet onShow token:', token, 'isLogin:', !!token, 'phoneBound:', phoneBound)\n if (!token || !phoneBound) {\n uni.showModal({\n title: '提示',\n content: '请先登录并绑定手机号',\n confirmText: '去登录',\n success: (res) => {\n if (res.confirm) {\n uni.navigateTo({ url: '/pages/login/index' })\n }\n }\n })\n }\n})\n</script>\n\n<style scoped>\n.wrap { padding: 40rpx }\n</style>","import MiniProgramPage from 'D:/project/app_client/pages/cabinet/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["onShow","uni"],"mappings":";;;;;AAMAA,kBAAAA,OAAO,MAAM;AACX,YAAM,QAAQC,cAAAA,MAAI,eAAe,OAAO;AACxC,YAAM,aAAa,CAAC,CAACA,oBAAI,eAAe,aAAa;AACrDA,oBAAAA,MAAY,MAAA,OAAA,iCAAA,yBAAyB,OAAO,YAAY,CAAC,CAAC,OAAO,eAAe,UAAU;AAC1F,UAAI,CAAC,SAAS,CAAC,YAAY;AACzBA,sBAAAA,MAAI,UAAU;AAAA,UACZ,OAAO;AAAA,UACP,SAAS;AAAA,UACT,aAAa;AAAA,UACb,SAAS,CAAC,QAAQ;AAChB,gBAAI,IAAI,SAAS;AACfA,4BAAAA,MAAI,WAAW,EAAE,KAAK,qBAAoB,CAAE;AAAA,YAC7C;AAAA,UACF;AAAA,QACP,CAAK;AAAA,MACF;AAAA,IACH,CAAC;;;;;;;ACrBD,GAAG,WAAW,eAAe;"}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sources":["pages/help/index.vue","../../迅雷下载/HBuilderX.4.57.2025032507/HBuilderX/plugins/uniapp-cli-vite/uniPage:/cGFnZXMvaGVscC9pbmRleC52dWU"],"sourcesContent":["<template>\n <view class=\"wrap\">\n <view class=\"card\" @click=\"toUser\">\n <view class=\"title\">用户协议</view>\n <view class=\"desc\">查看平台使用条款与隐私说明</view>\n </view>\n <view class=\"card\" @click=\"toPurchase\">\n <view class=\"title\">购买协议</view>\n <view class=\"desc\">查看盲盒购买规则与售后政策</view>\n </view>\n </view>\n</template>\n\n<script>\nexport default {\n methods: {\n toUser() { uni.navigateTo({ url: '/pages/agreement/user' }) },\n toPurchase() { uni.navigateTo({ url: '/pages/agreement/purchase' }) }\n }\n}\n</script>\n\n<style scoped>\n.wrap { padding: 24rpx }\n.card { background: #fff; border-radius: 12rpx; padding: 24rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04) }\n.title { font-size: 30rpx; font-weight: 600 }\n.desc { margin-top: 8rpx; font-size: 24rpx; color: #666 }\n</style>","import MiniProgramPage from 'D:/project/app_client/pages/help/index.vue'\nwx.createPage(MiniProgramPage)"],"names":["uni"],"mappings":";;AAcA,MAAK,YAAU;AAAA,EACb,SAAS;AAAA,IACP,SAAS;AAAEA,oBAAAA,MAAI,WAAW,EAAE,KAAK,wBAAsB,CAAG;AAAA,IAAG;AAAA,IAC7D,aAAa;AAAEA,oBAAAA,MAAI,WAAW,EAAE,KAAK,4BAA4B,CAAC;AAAA,IAAE;AAAA,EACtE;AACF;;;;;;;;AClBA,GAAG,WAAW,eAAe;"}
|
|
||||||
63
unpackage/dist/dev/mp-weixin/api/appUser.js
vendored
@ -1,63 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const utils_request = require("../utils/request.js");
|
|
||||||
function wechatLogin(code, invite_code) {
|
|
||||||
const data = invite_code ? { code, invite_code } : { code };
|
|
||||||
return utils_request.request({ url: "/api/app/users/weixin/login", method: "POST", data });
|
|
||||||
}
|
|
||||||
function bindPhone(user_id, code, extraHeader = {}) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/phone/bind`, method: "POST", data: { code }, header: extraHeader });
|
|
||||||
}
|
|
||||||
function getUserStats(user_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/stats`, method: "GET" });
|
|
||||||
}
|
|
||||||
function getPointsBalance(user_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/points/balance`, method: "GET" });
|
|
||||||
}
|
|
||||||
function getPointsRecords(user_id, page = 1, page_size = 20) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/points`, method: "GET", data: { page, page_size } });
|
|
||||||
}
|
|
||||||
function getOrders(user_id, status, page = 1, page_size = 20) {
|
|
||||||
const data = { page, page_size };
|
|
||||||
if (status)
|
|
||||||
data.status = status;
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/orders`, method: "GET", data });
|
|
||||||
}
|
|
||||||
function listAddresses(user_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/addresses`, method: "GET" });
|
|
||||||
}
|
|
||||||
function addAddress(user_id, payload) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/addresses`, method: "POST", data: payload });
|
|
||||||
}
|
|
||||||
function updateAddress(user_id, address_id, payload) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}`, method: "PUT", data: payload });
|
|
||||||
}
|
|
||||||
function deleteAddress(user_id, address_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}`, method: "DELETE" });
|
|
||||||
}
|
|
||||||
function setDefaultAddress(user_id, address_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/users/${user_id}/addresses/${address_id}/default`, method: "PUT" });
|
|
||||||
}
|
|
||||||
function getActivityDetail(activity_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/activities/${activity_id}`, method: "GET" });
|
|
||||||
}
|
|
||||||
function getActivityIssues(activity_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/activities/${activity_id}/issues`, method: "GET" });
|
|
||||||
}
|
|
||||||
function getActivityIssueRewards(activity_id, issue_id) {
|
|
||||||
return utils_request.authRequest({ url: `/api/app/activities/${activity_id}/issues/${issue_id}/rewards`, method: "GET" });
|
|
||||||
}
|
|
||||||
exports.addAddress = addAddress;
|
|
||||||
exports.bindPhone = bindPhone;
|
|
||||||
exports.deleteAddress = deleteAddress;
|
|
||||||
exports.getActivityDetail = getActivityDetail;
|
|
||||||
exports.getActivityIssueRewards = getActivityIssueRewards;
|
|
||||||
exports.getActivityIssues = getActivityIssues;
|
|
||||||
exports.getOrders = getOrders;
|
|
||||||
exports.getPointsBalance = getPointsBalance;
|
|
||||||
exports.getPointsRecords = getPointsRecords;
|
|
||||||
exports.getUserStats = getUserStats;
|
|
||||||
exports.listAddresses = listAddresses;
|
|
||||||
exports.setDefaultAddress = setDefaultAddress;
|
|
||||||
exports.updateAddress = updateAddress;
|
|
||||||
exports.wechatLogin = wechatLogin;
|
|
||||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/api/appUser.js.map
|
|
||||||
40
unpackage/dist/dev/mp-weixin/app.js
vendored
@ -1,40 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
||||||
const common_vendor = require("./common/vendor.js");
|
|
||||||
if (!Math) {
|
|
||||||
"./pages/index/index.js";
|
|
||||||
"./pages/login/index.js";
|
|
||||||
"./pages/shop/index.js";
|
|
||||||
"./pages/cabinet/index.js";
|
|
||||||
"./pages/mine/index.js";
|
|
||||||
"./pages/points/index.js";
|
|
||||||
"./pages/orders/index.js";
|
|
||||||
"./pages/address/index.js";
|
|
||||||
"./pages/address/edit.js";
|
|
||||||
"./pages/help/index.js";
|
|
||||||
"./pages/agreement/user.js";
|
|
||||||
"./pages/agreement/purchase.js";
|
|
||||||
"./pages/activity/yifanshang/index.js";
|
|
||||||
"./pages/activity/wuxianshang/index.js";
|
|
||||||
"./pages/activity/duiduipeng/index.js";
|
|
||||||
}
|
|
||||||
const _sfc_main = {
|
|
||||||
onLaunch: function() {
|
|
||||||
common_vendor.index.__f__("log", "at App.vue:4", "App Launch");
|
|
||||||
},
|
|
||||||
onShow: function() {
|
|
||||||
common_vendor.index.__f__("log", "at App.vue:7", "App Show");
|
|
||||||
},
|
|
||||||
onHide: function() {
|
|
||||||
common_vendor.index.__f__("log", "at App.vue:10", "App Hide");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function createApp() {
|
|
||||||
const app = common_vendor.createSSRApp(_sfc_main);
|
|
||||||
return {
|
|
||||||
app
|
|
||||||
};
|
|
||||||
}
|
|
||||||
createApp().app.mount("#app");
|
|
||||||
exports.createApp = createApp;
|
|
||||||
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|
|
||||||
58
unpackage/dist/dev/mp-weixin/app.json
vendored
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"pages": [
|
|
||||||
"pages/index/index",
|
|
||||||
"pages/login/index",
|
|
||||||
"pages/shop/index",
|
|
||||||
"pages/cabinet/index",
|
|
||||||
"pages/mine/index",
|
|
||||||
"pages/points/index",
|
|
||||||
"pages/orders/index",
|
|
||||||
"pages/address/index",
|
|
||||||
"pages/address/edit",
|
|
||||||
"pages/help/index",
|
|
||||||
"pages/agreement/user",
|
|
||||||
"pages/agreement/purchase",
|
|
||||||
"pages/activity/yifanshang/index",
|
|
||||||
"pages/activity/wuxianshang/index",
|
|
||||||
"pages/activity/duiduipeng/index"
|
|
||||||
],
|
|
||||||
"window": {
|
|
||||||
"navigationBarTextStyle": "black",
|
|
||||||
"navigationBarTitleText": "uni-app",
|
|
||||||
"navigationBarBackgroundColor": "#F8F8F8",
|
|
||||||
"backgroundColor": "#F8F8F8"
|
|
||||||
},
|
|
||||||
"tabBar": {
|
|
||||||
"color": "#7A7E83",
|
|
||||||
"selectedColor": "#007AFF",
|
|
||||||
"backgroundColor": "#FFFFFF",
|
|
||||||
"borderStyle": "black",
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"pagePath": "pages/index/index",
|
|
||||||
"text": "首页",
|
|
||||||
"iconPath": "static/tab/home.png",
|
|
||||||
"selectedIconPath": "static/tab/home_active.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/shop/index",
|
|
||||||
"text": "商城",
|
|
||||||
"iconPath": "static/tab/shop.png",
|
|
||||||
"selectedIconPath": "static/tab/shop_active.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/cabinet/index",
|
|
||||||
"text": "货柜",
|
|
||||||
"iconPath": "static/tab/box.png",
|
|
||||||
"selectedIconPath": "static/tab/box_active.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pagePath": "pages/mine/index",
|
|
||||||
"text": "我的",
|
|
||||||
"iconPath": "static/tab/profile.png",
|
|
||||||
"selectedIconPath": "static/tab/profile_active.png"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
3
unpackage/dist/dev/mp-weixin/app.wxss
vendored
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
/*每个页面公共css */
|
|
||||||
page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const _imports_0 = "/static/logo.png";
|
|
||||||
exports._imports_0 = _imports_0;
|
|
||||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/assets.js.map
|
|
||||||
7905
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
@ -1,137 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const detail = common_vendor.ref({});
|
|
||||||
const statusText = common_vendor.ref("");
|
|
||||||
const issues = common_vendor.ref([]);
|
|
||||||
const rewardsMap = common_vendor.ref({});
|
|
||||||
function statusToText(s) {
|
|
||||||
if (s === 1)
|
|
||||||
return "进行中";
|
|
||||||
if (s === 0)
|
|
||||||
return "未开始";
|
|
||||||
if (s === 2)
|
|
||||||
return "已结束";
|
|
||||||
return String(s || "");
|
|
||||||
}
|
|
||||||
async function fetchDetail(id) {
|
|
||||||
const data = await api_appUser.getActivityDetail(id);
|
|
||||||
detail.value = data || {};
|
|
||||||
statusText.value = statusToText(detail.value.status);
|
|
||||||
}
|
|
||||||
function unwrap(list) {
|
|
||||||
if (Array.isArray(list))
|
|
||||||
return list;
|
|
||||||
const obj = list || {};
|
|
||||||
const data = obj.data || {};
|
|
||||||
const arr = obj.list || obj.items || data.list || data.items || data;
|
|
||||||
return Array.isArray(arr) ? arr : [];
|
|
||||||
}
|
|
||||||
function normalizeIssues(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
no: i.no ?? i.index ?? i.issue_no ?? i.issue_number ?? null,
|
|
||||||
status_text: i.status_text ?? (i.status === 1 ? "进行中" : i.status === 0 ? "未开始" : i.status === 2 ? "已结束" : "")
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
function normalizeRewards(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
image: i.image ?? i.img ?? i.pic ?? i.banner ?? "",
|
|
||||||
odds: i.odds ?? i.rate ?? i.probability ?? i.prob ?? "",
|
|
||||||
rarity: i.rarity ?? i.rarity_name ?? ""
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
async function fetchRewardsForIssues(activityId) {
|
|
||||||
const list = issues.value || [];
|
|
||||||
const promises = list.map((it) => api_appUser.getActivityIssueRewards(activityId, it.id));
|
|
||||||
const results = await Promise.allSettled(promises);
|
|
||||||
results.forEach((res, i) => {
|
|
||||||
const issueId = list[i] && list[i].id;
|
|
||||||
if (!issueId)
|
|
||||||
return;
|
|
||||||
const value = res.status === "fulfilled" ? normalizeRewards(res.value) : [];
|
|
||||||
rewardsMap.value = { ...rewardsMap.value || {}, [issueId]: value };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function fetchIssues(id) {
|
|
||||||
const data = await api_appUser.getActivityIssues(id);
|
|
||||||
issues.value = normalizeIssues(data);
|
|
||||||
await fetchRewardsForIssues(id);
|
|
||||||
}
|
|
||||||
function onPreviewBanner() {
|
|
||||||
const url = detail.value.banner || "";
|
|
||||||
if (url)
|
|
||||||
common_vendor.index.previewImage({ urls: [url], current: url });
|
|
||||||
}
|
|
||||||
function onParticipate() {
|
|
||||||
common_vendor.index.showToast({ title: "功能待接入", icon: "none" });
|
|
||||||
}
|
|
||||||
common_vendor.onLoad((opts) => {
|
|
||||||
const id = opts && opts.id || "";
|
|
||||||
if (id) {
|
|
||||||
fetchDetail(id);
|
|
||||||
fetchIssues(id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: detail.value.banner
|
|
||||||
}, detail.value.banner ? {
|
|
||||||
b: detail.value.banner
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(detail.value.name || detail.value.title || "-"),
|
|
||||||
d: common_vendor.t(detail.value.category_name || "对对碰"),
|
|
||||||
e: detail.value.price_draw !== void 0
|
|
||||||
}, detail.value.price_draw !== void 0 ? {
|
|
||||||
f: common_vendor.t(detail.value.price_draw)
|
|
||||||
} : {}, {
|
|
||||||
g: detail.value.status !== void 0
|
|
||||||
}, detail.value.status !== void 0 ? {
|
|
||||||
h: common_vendor.t(statusText.value)
|
|
||||||
} : {}, {
|
|
||||||
i: common_vendor.o(onPreviewBanner),
|
|
||||||
j: common_vendor.o(onParticipate),
|
|
||||||
k: issues.value.length
|
|
||||||
}, issues.value.length ? {
|
|
||||||
l: common_vendor.f(issues.value, (it, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(it.title || "第" + (it.no || it.index || it.issue_no || "-") + "期"),
|
|
||||||
b: it.status_text
|
|
||||||
}, it.status_text ? {
|
|
||||||
c: common_vendor.t(it.status_text)
|
|
||||||
} : {}, {
|
|
||||||
d: rewardsMap.value[it.id] && rewardsMap.value[it.id].length
|
|
||||||
}, rewardsMap.value[it.id] && rewardsMap.value[it.id].length ? {
|
|
||||||
e: common_vendor.f(rewardsMap.value[it.id], (rw, k1, i1) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: rw.image
|
|
||||||
}, rw.image ? {
|
|
||||||
b: rw.image
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(rw.title),
|
|
||||||
d: rw.rarity || rw.odds
|
|
||||||
}, rw.rarity || rw.odds ? {
|
|
||||||
e: common_vendor.t([rw.rarity, rw.odds].filter(Boolean).join(" · "))
|
|
||||||
} : {}, {
|
|
||||||
f: rw.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
f: it.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e6d1f6ed"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/activity/duiduipeng/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "对对碰",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<scroll-view class="page data-v-e6d1f6ed" scroll-y><view wx:if="{{a}}" class="banner data-v-e6d1f6ed"><image class="banner-img data-v-e6d1f6ed" src="{{b}}" mode="widthFix"/></view><view class="header data-v-e6d1f6ed"><view class="title data-v-e6d1f6ed">{{c}}</view><view class="meta data-v-e6d1f6ed">分类:{{d}}</view><view wx:if="{{e}}" class="meta data-v-e6d1f6ed">参与价:¥{{f}}</view><view wx:if="{{g}}" class="meta data-v-e6d1f6ed">状态:{{h}}</view></view><view class="actions data-v-e6d1f6ed"><button class="btn data-v-e6d1f6ed" bindtap="{{i}}">查看图片</button><button class="btn primary data-v-e6d1f6ed" bindtap="{{j}}">立即参与</button></view><view class="issues data-v-e6d1f6ed"><view class="issues-title data-v-e6d1f6ed">期数</view><view wx:if="{{k}}" class="issues-list data-v-e6d1f6ed"><view wx:for="{{l}}" wx:for-item="it" wx:key="f" class="issue-item data-v-e6d1f6ed"><text class="issue-title data-v-e6d1f6ed">{{it.a}}</text><text wx:if="{{it.b}}" class="issue-status data-v-e6d1f6ed">{{it.c}}</text><view wx:if="{{it.d}}" class="rewards data-v-e6d1f6ed"><view wx:for="{{it.e}}" wx:for-item="rw" wx:key="f" class="reward data-v-e6d1f6ed"><image wx:if="{{rw.a}}" class="reward-img data-v-e6d1f6ed" src="{{rw.b}}" mode="aspectFill"/><view class="reward-texts data-v-e6d1f6ed"><text class="reward-title data-v-e6d1f6ed">{{rw.c}}</text><text wx:if="{{rw.d}}" class="reward-meta data-v-e6d1f6ed">{{rw.e}}</text></view></view></view><view wx:else class="rewards-empty data-v-e6d1f6ed">暂无奖励配置</view></view></view><view wx:else class="issues-empty data-v-e6d1f6ed">暂无期数</view></view></scroll-view>
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-e6d1f6ed { height: 100vh
|
|
||||||
}
|
|
||||||
.banner.data-v-e6d1f6ed { padding: 24rpx
|
|
||||||
}
|
|
||||||
.banner-img.data-v-e6d1f6ed { width: 100%
|
|
||||||
}
|
|
||||||
.header.data-v-e6d1f6ed { padding: 0 24rpx
|
|
||||||
}
|
|
||||||
.title.data-v-e6d1f6ed { font-size: 36rpx; font-weight: 700
|
|
||||||
}
|
|
||||||
.meta.data-v-e6d1f6ed { margin-top: 8rpx; font-size: 26rpx; color: #666
|
|
||||||
}
|
|
||||||
.actions.data-v-e6d1f6ed { display: flex; padding: 24rpx; gap: 16rpx
|
|
||||||
}
|
|
||||||
.btn.data-v-e6d1f6ed { flex: 1
|
|
||||||
}
|
|
||||||
.primary.data-v-e6d1f6ed { background-color: #007AFF; color: #fff
|
|
||||||
}
|
|
||||||
.issues.data-v-e6d1f6ed { background: #fff; border-radius: 12rpx; margin: 0 24rpx 24rpx; padding: 16rpx
|
|
||||||
}
|
|
||||||
.issues-title.data-v-e6d1f6ed { font-size: 30rpx; font-weight: 600; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.issues-list.data-v-e6d1f6ed {
|
|
||||||
}
|
|
||||||
.issue-item.data-v-e6d1f6ed { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #f0f0f0
|
|
||||||
}
|
|
||||||
.issue-item.data-v-e6d1f6ed:last-child { border-bottom: 0
|
|
||||||
}
|
|
||||||
.issue-title.data-v-e6d1f6ed { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.issue-status.data-v-e6d1f6ed { font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
.rewards.data-v-e6d1f6ed { width: 100%; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.reward.data-v-e6d1f6ed { display: flex; align-items: center; margin-bottom: 8rpx
|
|
||||||
}
|
|
||||||
.reward-img.data-v-e6d1f6ed { width: 80rpx; height: 80rpx; border-radius: 8rpx; margin-right: 12rpx; background: #f5f5f5
|
|
||||||
}
|
|
||||||
.reward-texts.data-v-e6d1f6ed { display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.reward-title.data-v-e6d1f6ed { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.reward-meta.data-v-e6d1f6ed { font-size: 22rpx; color: #888
|
|
||||||
}
|
|
||||||
.rewards-empty.data-v-e6d1f6ed { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
.issues-empty.data-v-e6d1f6ed { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
@ -1,137 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const detail = common_vendor.ref({});
|
|
||||||
const statusText = common_vendor.ref("");
|
|
||||||
const issues = common_vendor.ref([]);
|
|
||||||
const rewardsMap = common_vendor.ref({});
|
|
||||||
function statusToText(s) {
|
|
||||||
if (s === 1)
|
|
||||||
return "进行中";
|
|
||||||
if (s === 0)
|
|
||||||
return "未开始";
|
|
||||||
if (s === 2)
|
|
||||||
return "已结束";
|
|
||||||
return String(s || "");
|
|
||||||
}
|
|
||||||
async function fetchDetail(id) {
|
|
||||||
const data = await api_appUser.getActivityDetail(id);
|
|
||||||
detail.value = data || {};
|
|
||||||
statusText.value = statusToText(detail.value.status);
|
|
||||||
}
|
|
||||||
function unwrap(list) {
|
|
||||||
if (Array.isArray(list))
|
|
||||||
return list;
|
|
||||||
const obj = list || {};
|
|
||||||
const data = obj.data || {};
|
|
||||||
const arr = obj.list || obj.items || data.list || data.items || data;
|
|
||||||
return Array.isArray(arr) ? arr : [];
|
|
||||||
}
|
|
||||||
function normalizeIssues(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
no: i.no ?? i.index ?? i.issue_no ?? i.issue_number ?? null,
|
|
||||||
status_text: i.status_text ?? (i.status === 1 ? "进行中" : i.status === 0 ? "未开始" : i.status === 2 ? "已结束" : "")
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
function normalizeRewards(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
image: i.image ?? i.img ?? i.pic ?? i.banner ?? "",
|
|
||||||
odds: i.odds ?? i.rate ?? i.probability ?? i.prob ?? "",
|
|
||||||
rarity: i.rarity ?? i.rarity_name ?? ""
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
async function fetchRewardsForIssues(activityId) {
|
|
||||||
const list = issues.value || [];
|
|
||||||
const promises = list.map((it) => api_appUser.getActivityIssueRewards(activityId, it.id));
|
|
||||||
const results = await Promise.allSettled(promises);
|
|
||||||
results.forEach((res, i) => {
|
|
||||||
const issueId = list[i] && list[i].id;
|
|
||||||
if (!issueId)
|
|
||||||
return;
|
|
||||||
const value = res.status === "fulfilled" ? normalizeRewards(res.value) : [];
|
|
||||||
rewardsMap.value = { ...rewardsMap.value || {}, [issueId]: value };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function fetchIssues(id) {
|
|
||||||
const data = await api_appUser.getActivityIssues(id);
|
|
||||||
issues.value = normalizeIssues(data);
|
|
||||||
await fetchRewardsForIssues(id);
|
|
||||||
}
|
|
||||||
function onPreviewBanner() {
|
|
||||||
const url = detail.value.banner || "";
|
|
||||||
if (url)
|
|
||||||
common_vendor.index.previewImage({ urls: [url], current: url });
|
|
||||||
}
|
|
||||||
function onParticipate() {
|
|
||||||
common_vendor.index.showToast({ title: "功能待接入", icon: "none" });
|
|
||||||
}
|
|
||||||
common_vendor.onLoad((opts) => {
|
|
||||||
const id = opts && opts.id || "";
|
|
||||||
if (id) {
|
|
||||||
fetchDetail(id);
|
|
||||||
fetchIssues(id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: detail.value.banner
|
|
||||||
}, detail.value.banner ? {
|
|
||||||
b: detail.value.banner
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(detail.value.name || detail.value.title || "-"),
|
|
||||||
d: common_vendor.t(detail.value.category_name || "无限赏"),
|
|
||||||
e: detail.value.price_draw !== void 0
|
|
||||||
}, detail.value.price_draw !== void 0 ? {
|
|
||||||
f: common_vendor.t(detail.value.price_draw)
|
|
||||||
} : {}, {
|
|
||||||
g: detail.value.status !== void 0
|
|
||||||
}, detail.value.status !== void 0 ? {
|
|
||||||
h: common_vendor.t(statusText.value)
|
|
||||||
} : {}, {
|
|
||||||
i: common_vendor.o(onPreviewBanner),
|
|
||||||
j: common_vendor.o(onParticipate),
|
|
||||||
k: issues.value.length
|
|
||||||
}, issues.value.length ? {
|
|
||||||
l: common_vendor.f(issues.value, (it, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(it.title || "第" + (it.no || it.index || it.issue_no || "-") + "期"),
|
|
||||||
b: it.status_text
|
|
||||||
}, it.status_text ? {
|
|
||||||
c: common_vendor.t(it.status_text)
|
|
||||||
} : {}, {
|
|
||||||
d: rewardsMap.value[it.id] && rewardsMap.value[it.id].length
|
|
||||||
}, rewardsMap.value[it.id] && rewardsMap.value[it.id].length ? {
|
|
||||||
e: common_vendor.f(rewardsMap.value[it.id], (rw, k1, i1) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: rw.image
|
|
||||||
}, rw.image ? {
|
|
||||||
b: rw.image
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(rw.title),
|
|
||||||
d: rw.rarity || rw.odds
|
|
||||||
}, rw.rarity || rw.odds ? {
|
|
||||||
e: common_vendor.t([rw.rarity, rw.odds].filter(Boolean).join(" · "))
|
|
||||||
} : {}, {
|
|
||||||
f: rw.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
f: it.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b5fdbf1f"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/activity/wuxianshang/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "无限赏",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<scroll-view class="page data-v-b5fdbf1f" scroll-y><view wx:if="{{a}}" class="banner data-v-b5fdbf1f"><image class="banner-img data-v-b5fdbf1f" src="{{b}}" mode="widthFix"/></view><view class="header data-v-b5fdbf1f"><view class="title data-v-b5fdbf1f">{{c}}</view><view class="meta data-v-b5fdbf1f">分类:{{d}}</view><view wx:if="{{e}}" class="meta data-v-b5fdbf1f">单次抽选:¥{{f}}</view><view wx:if="{{g}}" class="meta data-v-b5fdbf1f">状态:{{h}}</view></view><view class="actions data-v-b5fdbf1f"><button class="btn data-v-b5fdbf1f" bindtap="{{i}}">查看图片</button><button class="btn primary data-v-b5fdbf1f" bindtap="{{j}}">立即参与</button></view><view class="issues data-v-b5fdbf1f"><view class="issues-title data-v-b5fdbf1f">期数</view><view wx:if="{{k}}" class="issues-list data-v-b5fdbf1f"><view wx:for="{{l}}" wx:for-item="it" wx:key="f" class="issue-item data-v-b5fdbf1f"><text class="issue-title data-v-b5fdbf1f">{{it.a}}</text><text wx:if="{{it.b}}" class="issue-status data-v-b5fdbf1f">{{it.c}}</text><view wx:if="{{it.d}}" class="rewards data-v-b5fdbf1f"><view wx:for="{{it.e}}" wx:for-item="rw" wx:key="f" class="reward data-v-b5fdbf1f"><image wx:if="{{rw.a}}" class="reward-img data-v-b5fdbf1f" src="{{rw.b}}" mode="aspectFill"/><view class="reward-texts data-v-b5fdbf1f"><text class="reward-title data-v-b5fdbf1f">{{rw.c}}</text><text wx:if="{{rw.d}}" class="reward-meta data-v-b5fdbf1f">{{rw.e}}</text></view></view></view><view wx:else class="rewards-empty data-v-b5fdbf1f">暂无奖励配置</view></view></view><view wx:else class="issues-empty data-v-b5fdbf1f">暂无期数</view></view></scroll-view>
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-b5fdbf1f { height: 100vh
|
|
||||||
}
|
|
||||||
.banner.data-v-b5fdbf1f { padding: 24rpx
|
|
||||||
}
|
|
||||||
.banner-img.data-v-b5fdbf1f { width: 100%
|
|
||||||
}
|
|
||||||
.header.data-v-b5fdbf1f { padding: 0 24rpx
|
|
||||||
}
|
|
||||||
.title.data-v-b5fdbf1f { font-size: 36rpx; font-weight: 700
|
|
||||||
}
|
|
||||||
.meta.data-v-b5fdbf1f { margin-top: 8rpx; font-size: 26rpx; color: #666
|
|
||||||
}
|
|
||||||
.actions.data-v-b5fdbf1f { display: flex; padding: 24rpx; gap: 16rpx
|
|
||||||
}
|
|
||||||
.btn.data-v-b5fdbf1f { flex: 1
|
|
||||||
}
|
|
||||||
.primary.data-v-b5fdbf1f { background-color: #007AFF; color: #fff
|
|
||||||
}
|
|
||||||
.issues.data-v-b5fdbf1f { background: #fff; border-radius: 12rpx; margin: 0 24rpx 24rpx; padding: 16rpx
|
|
||||||
}
|
|
||||||
.issues-title.data-v-b5fdbf1f { font-size: 30rpx; font-weight: 600; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.issues-list.data-v-b5fdbf1f {
|
|
||||||
}
|
|
||||||
.issue-item.data-v-b5fdbf1f { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #f0f0f0
|
|
||||||
}
|
|
||||||
.issue-item.data-v-b5fdbf1f:last-child { border-bottom: 0
|
|
||||||
}
|
|
||||||
.issue-title.data-v-b5fdbf1f { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.issue-status.data-v-b5fdbf1f { font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
.rewards.data-v-b5fdbf1f { width: 100%; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.reward.data-v-b5fdbf1f { display: flex; align-items: center; margin-bottom: 8rpx
|
|
||||||
}
|
|
||||||
.reward-img.data-v-b5fdbf1f { width: 80rpx; height: 80rpx; border-radius: 8rpx; margin-right: 12rpx; background: #f5f5f5
|
|
||||||
}
|
|
||||||
.reward-texts.data-v-b5fdbf1f { display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.reward-title.data-v-b5fdbf1f { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.reward-meta.data-v-b5fdbf1f { font-size: 22rpx; color: #888
|
|
||||||
}
|
|
||||||
.rewards-empty.data-v-b5fdbf1f { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
.issues-empty.data-v-b5fdbf1f { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
@ -1,137 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const detail = common_vendor.ref({});
|
|
||||||
const issues = common_vendor.ref([]);
|
|
||||||
const rewardsMap = common_vendor.ref({});
|
|
||||||
function statusToText(s) {
|
|
||||||
if (s === 1)
|
|
||||||
return "进行中";
|
|
||||||
if (s === 0)
|
|
||||||
return "未开始";
|
|
||||||
if (s === 2)
|
|
||||||
return "已结束";
|
|
||||||
return String(s || "");
|
|
||||||
}
|
|
||||||
const statusText = common_vendor.ref("");
|
|
||||||
async function fetchDetail(id) {
|
|
||||||
const data = await api_appUser.getActivityDetail(id);
|
|
||||||
detail.value = data || {};
|
|
||||||
statusText.value = statusToText(detail.value.status);
|
|
||||||
}
|
|
||||||
function unwrap(list) {
|
|
||||||
if (Array.isArray(list))
|
|
||||||
return list;
|
|
||||||
const obj = list || {};
|
|
||||||
const data = obj.data || {};
|
|
||||||
const arr = obj.list || obj.items || data.list || data.items || data;
|
|
||||||
return Array.isArray(arr) ? arr : [];
|
|
||||||
}
|
|
||||||
function normalizeIssues(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
no: i.no ?? i.index ?? i.issue_no ?? i.issue_number ?? null,
|
|
||||||
status_text: i.status_text ?? (i.status === 1 ? "进行中" : i.status === 0 ? "未开始" : i.status === 2 ? "已结束" : "")
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
function normalizeRewards(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
image: i.image ?? i.img ?? i.pic ?? i.banner ?? "",
|
|
||||||
odds: i.odds ?? i.rate ?? i.probability ?? i.prob ?? "",
|
|
||||||
rarity: i.rarity ?? i.rarity_name ?? ""
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
async function fetchRewardsForIssues(activityId) {
|
|
||||||
const list = issues.value || [];
|
|
||||||
const promises = list.map((it) => api_appUser.getActivityIssueRewards(activityId, it.id));
|
|
||||||
const results = await Promise.allSettled(promises);
|
|
||||||
results.forEach((res, i) => {
|
|
||||||
const issueId = list[i] && list[i].id;
|
|
||||||
if (!issueId)
|
|
||||||
return;
|
|
||||||
const value = res.status === "fulfilled" ? normalizeRewards(res.value) : [];
|
|
||||||
rewardsMap.value = { ...rewardsMap.value || {}, [issueId]: value };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function fetchIssues(id) {
|
|
||||||
const data = await api_appUser.getActivityIssues(id);
|
|
||||||
issues.value = normalizeIssues(data);
|
|
||||||
await fetchRewardsForIssues(id);
|
|
||||||
}
|
|
||||||
function onPreviewBanner() {
|
|
||||||
const url = detail.value.banner || "";
|
|
||||||
if (url)
|
|
||||||
common_vendor.index.previewImage({ urls: [url], current: url });
|
|
||||||
}
|
|
||||||
function onParticipate() {
|
|
||||||
common_vendor.index.showToast({ title: "功能待接入", icon: "none" });
|
|
||||||
}
|
|
||||||
common_vendor.onLoad((opts) => {
|
|
||||||
const id = opts && opts.id || "";
|
|
||||||
if (id) {
|
|
||||||
fetchDetail(id);
|
|
||||||
fetchIssues(id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: detail.value.banner
|
|
||||||
}, detail.value.banner ? {
|
|
||||||
b: detail.value.banner
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(detail.value.name || detail.value.title || "-"),
|
|
||||||
d: common_vendor.t(detail.value.category_name || "一番赏"),
|
|
||||||
e: detail.value.price_draw !== void 0
|
|
||||||
}, detail.value.price_draw !== void 0 ? {
|
|
||||||
f: common_vendor.t(detail.value.price_draw)
|
|
||||||
} : {}, {
|
|
||||||
g: detail.value.status !== void 0
|
|
||||||
}, detail.value.status !== void 0 ? {
|
|
||||||
h: common_vendor.t(statusText.value)
|
|
||||||
} : {}, {
|
|
||||||
i: common_vendor.o(onPreviewBanner),
|
|
||||||
j: common_vendor.o(onParticipate),
|
|
||||||
k: issues.value.length
|
|
||||||
}, issues.value.length ? {
|
|
||||||
l: common_vendor.f(issues.value, (it, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(it.title || "第" + (it.no || it.index || it.issue_no || "-") + "期"),
|
|
||||||
b: it.status_text
|
|
||||||
}, it.status_text ? {
|
|
||||||
c: common_vendor.t(it.status_text)
|
|
||||||
} : {}, {
|
|
||||||
d: rewardsMap.value[it.id] && rewardsMap.value[it.id].length
|
|
||||||
}, rewardsMap.value[it.id] && rewardsMap.value[it.id].length ? {
|
|
||||||
e: common_vendor.f(rewardsMap.value[it.id], (rw, k1, i1) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: rw.image
|
|
||||||
}, rw.image ? {
|
|
||||||
b: rw.image
|
|
||||||
} : {}, {
|
|
||||||
c: common_vendor.t(rw.title),
|
|
||||||
d: rw.rarity || rw.odds
|
|
||||||
}, rw.rarity || rw.odds ? {
|
|
||||||
e: common_vendor.t([rw.rarity, rw.odds].filter(Boolean).join(" · "))
|
|
||||||
} : {}, {
|
|
||||||
f: rw.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {}, {
|
|
||||||
f: it.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3c32883e"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/activity/yifanshang/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "一番赏",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<scroll-view class="page data-v-3c32883e" scroll-y><view wx:if="{{a}}" class="banner data-v-3c32883e"><image class="banner-img data-v-3c32883e" src="{{b}}" mode="widthFix"/></view><view class="header data-v-3c32883e"><view class="title data-v-3c32883e">{{c}}</view><view class="meta data-v-3c32883e">分类:{{d}}</view><view wx:if="{{e}}" class="meta data-v-3c32883e">抽选价:¥{{f}}</view><view wx:if="{{g}}" class="meta data-v-3c32883e">状态:{{h}}</view></view><view class="actions data-v-3c32883e"><button class="btn data-v-3c32883e" bindtap="{{i}}">查看图片</button><button class="btn primary data-v-3c32883e" bindtap="{{j}}">立即参与</button></view><view class="issues data-v-3c32883e"><view class="issues-title data-v-3c32883e">期数</view><view wx:if="{{k}}" class="issues-list data-v-3c32883e"><view wx:for="{{l}}" wx:for-item="it" wx:key="f" class="issue-item data-v-3c32883e"><text class="issue-title data-v-3c32883e">{{it.a}}</text><text wx:if="{{it.b}}" class="issue-status data-v-3c32883e">{{it.c}}</text><view wx:if="{{it.d}}" class="rewards data-v-3c32883e"><view wx:for="{{it.e}}" wx:for-item="rw" wx:key="f" class="reward data-v-3c32883e"><image wx:if="{{rw.a}}" class="reward-img data-v-3c32883e" src="{{rw.b}}" mode="aspectFill"/><view class="reward-texts data-v-3c32883e"><text class="reward-title data-v-3c32883e">{{rw.c}}</text><text wx:if="{{rw.d}}" class="reward-meta data-v-3c32883e">{{rw.e}}</text></view></view></view><view wx:else class="rewards-empty data-v-3c32883e">暂无奖励配置</view></view></view><view wx:else class="issues-empty data-v-3c32883e">暂无期数</view></view></scroll-view>
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-3c32883e { height: 100vh
|
|
||||||
}
|
|
||||||
.banner.data-v-3c32883e { padding: 24rpx
|
|
||||||
}
|
|
||||||
.banner-img.data-v-3c32883e { width: 100%
|
|
||||||
}
|
|
||||||
.header.data-v-3c32883e { padding: 0 24rpx
|
|
||||||
}
|
|
||||||
.title.data-v-3c32883e { font-size: 36rpx; font-weight: 700
|
|
||||||
}
|
|
||||||
.meta.data-v-3c32883e { margin-top: 8rpx; font-size: 26rpx; color: #666
|
|
||||||
}
|
|
||||||
.actions.data-v-3c32883e { display: flex; padding: 24rpx; gap: 16rpx
|
|
||||||
}
|
|
||||||
.btn.data-v-3c32883e { flex: 1
|
|
||||||
}
|
|
||||||
.primary.data-v-3c32883e { background-color: #007AFF; color: #fff
|
|
||||||
}
|
|
||||||
.issues.data-v-3c32883e { background: #fff; border-radius: 12rpx; margin: 0 24rpx 24rpx; padding: 16rpx
|
|
||||||
}
|
|
||||||
.issues-title.data-v-3c32883e { font-size: 30rpx; font-weight: 600; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.issues-list.data-v-3c32883e {
|
|
||||||
}
|
|
||||||
.issue-item.data-v-3c32883e { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #f0f0f0
|
|
||||||
}
|
|
||||||
.issue-item.data-v-3c32883e:last-child { border-bottom: 0
|
|
||||||
}
|
|
||||||
.issue-title.data-v-3c32883e { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.issue-status.data-v-3c32883e { font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
.rewards.data-v-3c32883e { width: 100%; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.reward.data-v-3c32883e { display: flex; align-items: center; margin-bottom: 8rpx
|
|
||||||
}
|
|
||||||
.reward-img.data-v-3c32883e { width: 80rpx; height: 80rpx; border-radius: 8rpx; margin-right: 12rpx; background: #f5f5f5
|
|
||||||
}
|
|
||||||
.reward-texts.data-v-3c32883e { display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.reward-title.data-v-3c32883e { font-size: 26rpx
|
|
||||||
}
|
|
||||||
.reward-meta.data-v-3c32883e { font-size: 22rpx; color: #888
|
|
||||||
}
|
|
||||||
.rewards-empty.data-v-3c32883e { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
.issues-empty.data-v-3c32883e { font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
144
unpackage/dist/dev/mp-weixin/pages/address/edit.js
vendored
@ -1,144 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "edit",
|
|
||||||
setup(__props) {
|
|
||||||
const id = common_vendor.ref("");
|
|
||||||
const name = common_vendor.ref("");
|
|
||||||
const mobile = common_vendor.ref("");
|
|
||||||
const province = common_vendor.ref("");
|
|
||||||
const city = common_vendor.ref("");
|
|
||||||
const district = common_vendor.ref("");
|
|
||||||
const detail = common_vendor.ref("");
|
|
||||||
let isDefault = false;
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
function fill(data) {
|
|
||||||
name.value = data.name || data.realname || "";
|
|
||||||
mobile.value = data.mobile || data.phone || "";
|
|
||||||
province.value = data.province || "";
|
|
||||||
city.value = data.city || "";
|
|
||||||
district.value = data.district || "";
|
|
||||||
detail.value = data.address || data.detail || "";
|
|
||||||
isDefault = !!data.is_default;
|
|
||||||
}
|
|
||||||
async function init(idParam) {
|
|
||||||
if (!idParam) {
|
|
||||||
const data = common_vendor.index.getStorageSync("edit_address") || {};
|
|
||||||
if (data && data.id)
|
|
||||||
fill(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
try {
|
|
||||||
const list = await api_appUser.listAddresses(user_id);
|
|
||||||
const arr = Array.isArray(list) ? list : list && (list.list || list.items) || [];
|
|
||||||
const found = arr.find((a) => String(a.id) === String(idParam));
|
|
||||||
if (found)
|
|
||||||
fill(found);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async function onSubmit() {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
if (!name.value || !mobile.value || !province.value || !city.value || !district.value || !detail.value) {
|
|
||||||
common_vendor.index.showToast({ title: "请完善必填信息", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loading.value = true;
|
|
||||||
error.value = "";
|
|
||||||
const payload = {
|
|
||||||
name: name.value,
|
|
||||||
mobile: mobile.value,
|
|
||||||
province: province.value,
|
|
||||||
city: city.value,
|
|
||||||
district: district.value,
|
|
||||||
address: detail.value,
|
|
||||||
is_default: isDefault
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
let savedId = id.value;
|
|
||||||
if (id.value) {
|
|
||||||
await api_appUser.updateAddress(user_id, id.value, payload);
|
|
||||||
savedId = id.value;
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
const res = await api_appUser.addAddress(user_id, payload);
|
|
||||||
savedId = res && (res.id || res.address_id) || "";
|
|
||||||
} catch (eAdd) {
|
|
||||||
const sc = eAdd && eAdd.statusCode;
|
|
||||||
const bc = eAdd && eAdd.data && (eAdd.data.code || eAdd.code) || void 0;
|
|
||||||
const msg = eAdd && (eAdd.message || eAdd.errMsg || "");
|
|
||||||
const isUniqueErr = sc === 400 && (bc === 10011 || msg && msg.toLowerCase().includes("unique"));
|
|
||||||
if (isUniqueErr) {
|
|
||||||
try {
|
|
||||||
const list = await api_appUser.listAddresses(user_id);
|
|
||||||
const arr = Array.isArray(list) ? list : list && (list.list || list.items) || [];
|
|
||||||
const found = arr.find((a) => (a.mobile === mobile.value || a.phone === mobile.value) && (a.address === detail.value || a.detail === detail.value) && a.city === city.value && a.district === district.value && a.province === province.value);
|
|
||||||
if (found) {
|
|
||||||
savedId = found.id;
|
|
||||||
await api_appUser.updateAddress(user_id, savedId, payload);
|
|
||||||
}
|
|
||||||
} catch (_) {
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw eAdd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isDefault) {
|
|
||||||
if (!savedId) {
|
|
||||||
try {
|
|
||||||
const list = await api_appUser.listAddresses(user_id);
|
|
||||||
const arr = Array.isArray(list) ? list : list && (list.list || list.items) || [];
|
|
||||||
const found = arr.find((a) => (a.mobile === mobile.value || a.phone === mobile.value) && (a.address === detail.value || a.detail === detail.value));
|
|
||||||
if (found)
|
|
||||||
savedId = found.id;
|
|
||||||
} catch (_) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (savedId) {
|
|
||||||
await api_appUser.setDefaultAddress(user_id, savedId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.index.showToast({ title: "保存成功", icon: "success" });
|
|
||||||
common_vendor.index.navigateBack();
|
|
||||||
} catch (e) {
|
|
||||||
error.value = e && (e.message || e.errMsg) || "保存失败";
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.onLoad((opts) => {
|
|
||||||
id.value = opts && opts.id || "";
|
|
||||||
init(id.value);
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: name.value,
|
|
||||||
b: common_vendor.o(($event) => name.value = $event.detail.value),
|
|
||||||
c: mobile.value,
|
|
||||||
d: common_vendor.o(($event) => mobile.value = $event.detail.value),
|
|
||||||
e: province.value,
|
|
||||||
f: common_vendor.o(($event) => province.value = $event.detail.value),
|
|
||||||
g: city.value,
|
|
||||||
h: common_vendor.o(($event) => city.value = $event.detail.value),
|
|
||||||
i: district.value,
|
|
||||||
j: common_vendor.o(($event) => district.value = $event.detail.value),
|
|
||||||
k: detail.value,
|
|
||||||
l: common_vendor.o(($event) => detail.value = $event.detail.value),
|
|
||||||
m: common_vendor.unref(isDefault),
|
|
||||||
n: common_vendor.o((e) => common_vendor.isRef(isDefault) ? isDefault.value = e.detail.value : isDefault = e.detail.value),
|
|
||||||
o: loading.value,
|
|
||||||
p: common_vendor.o(onSubmit),
|
|
||||||
q: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
r: common_vendor.t(error.value)
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-dcb1f0d8"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/address/edit.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "编辑地址",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-dcb1f0d8"><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">姓名</text><input class="input data-v-dcb1f0d8" placeholder="请输入姓名" value="{{a}}" bindinput="{{b}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">手机号</text><input class="input data-v-dcb1f0d8" placeholder="请输入手机号" value="{{c}}" bindinput="{{d}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">省份</text><input class="input data-v-dcb1f0d8" placeholder="请输入省份" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">城市</text><input class="input data-v-dcb1f0d8" placeholder="请输入城市" value="{{g}}" bindinput="{{h}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">区县</text><input class="input data-v-dcb1f0d8" placeholder="请输入区县" value="{{i}}" bindinput="{{j}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">详细地址</text><input class="input data-v-dcb1f0d8" placeholder="请输入详细地址" value="{{k}}" bindinput="{{l}}"/></view><view class="form-item data-v-dcb1f0d8"><text class="label data-v-dcb1f0d8">设为默认</text><switch class="data-v-dcb1f0d8" checked="{{m}}" bindchange="{{n}}"/></view><button class="submit data-v-dcb1f0d8" disabled="{{o}}" bindtap="{{p}}">保存</button><view wx:if="{{q}}" class="error data-v-dcb1f0d8">{{r}}</view></view>
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-dcb1f0d8 { padding: 24rpx
|
|
||||||
}
|
|
||||||
.form-item.data-v-dcb1f0d8 { display: flex; align-items: center; background: #fff; border-radius: 12rpx; padding: 16rpx; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.label.data-v-dcb1f0d8 { width: 160rpx; font-size: 28rpx; color: #666
|
|
||||||
}
|
|
||||||
.input.data-v-dcb1f0d8 { flex: 1; font-size: 28rpx
|
|
||||||
}
|
|
||||||
.submit.data-v-dcb1f0d8 { width: 100%; margin-top: 20rpx
|
|
||||||
}
|
|
||||||
.error.data-v-dcb1f0d8 { color: #e43; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
107
unpackage/dist/dev/mp-weixin/pages/address/index.js
vendored
@ -1,107 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const list = common_vendor.ref([]);
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
async function fetchList() {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!user_id || !token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loading.value = true;
|
|
||||||
error.value = "";
|
|
||||||
try {
|
|
||||||
const data = await api_appUser.listAddresses(user_id);
|
|
||||||
list.value = Array.isArray(data) ? data : data && (data.list || data.items) || [];
|
|
||||||
} catch (e) {
|
|
||||||
error.value = e && (e.message || e.errMsg) || "获取地址失败";
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function toAdd() {
|
|
||||||
common_vendor.index.removeStorageSync("edit_address");
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/address/edit" });
|
|
||||||
}
|
|
||||||
function toEdit(item) {
|
|
||||||
common_vendor.index.setStorageSync("edit_address", item);
|
|
||||||
common_vendor.index.navigateTo({ url: `/pages/address/edit?id=${item.id}` });
|
|
||||||
}
|
|
||||||
function onDelete(item) {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "确认删除",
|
|
||||||
content: "确定删除该地址吗?",
|
|
||||||
success: async (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
try {
|
|
||||||
await api_appUser.deleteAddress(user_id, item.id);
|
|
||||||
fetchList();
|
|
||||||
} catch (e) {
|
|
||||||
common_vendor.index.showToast({ title: "删除失败", icon: "none" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function onSetDefault(item) {
|
|
||||||
try {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
await api_appUser.setDefaultAddress(user_id, item.id);
|
|
||||||
fetchList();
|
|
||||||
} catch (e) {
|
|
||||||
common_vendor.index.showToast({ title: "设置失败", icon: "none" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.onLoad(() => {
|
|
||||||
fetchList();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.o(toAdd),
|
|
||||||
b: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
c: common_vendor.t(error.value)
|
|
||||||
} : {}, {
|
|
||||||
d: list.value.length === 0 && !loading.value
|
|
||||||
}, list.value.length === 0 && !loading.value ? {} : {}, {
|
|
||||||
e: common_vendor.f(list.value, (item, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.t(item.name || item.realname),
|
|
||||||
b: common_vendor.t(item.phone || item.mobile),
|
|
||||||
c: item.is_default
|
|
||||||
}, item.is_default ? {} : {}, {
|
|
||||||
d: common_vendor.t(item.province),
|
|
||||||
e: common_vendor.t(item.city),
|
|
||||||
f: common_vendor.t(item.district),
|
|
||||||
g: common_vendor.t(item.address || item.detail),
|
|
||||||
h: common_vendor.o(($event) => toEdit(item), item.id),
|
|
||||||
i: common_vendor.o(($event) => onDelete(item), item.id),
|
|
||||||
j: item.is_default,
|
|
||||||
k: common_vendor.o(($event) => onSetDefault(item), item.id),
|
|
||||||
l: item.id
|
|
||||||
});
|
|
||||||
})
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c47feaaa"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/address/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "地址管理",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-c47feaaa"><view class="header data-v-c47feaaa"><button class="add data-v-c47feaaa" bindtap="{{a}}">新增地址</button></view><view wx:if="{{b}}" class="error data-v-c47feaaa">{{c}}</view><view wx:if="{{d}}" class="empty data-v-c47feaaa">暂无地址</view><view wx:for="{{e}}" wx:for-item="item" wx:key="l" class="addr data-v-c47feaaa"><view class="addr-main data-v-c47feaaa"><view class="addr-row data-v-c47feaaa"><text class="name data-v-c47feaaa">姓名:{{item.a}}</text></view><view class="addr-row data-v-c47feaaa"><text class="phone data-v-c47feaaa">手机号:{{item.b}}</text></view><view wx:if="{{item.c}}" class="addr-row data-v-c47feaaa"><text class="default data-v-c47feaaa">默认</text></view><view class="addr-row data-v-c47feaaa"><text class="region data-v-c47feaaa">省市区:{{item.d}}{{item.e}}{{item.f}}</text></view><view class="addr-row data-v-c47feaaa"><text class="detail data-v-c47feaaa">详细地址:{{item.g}}</text></view></view><view class="addr-actions data-v-c47feaaa"><button class="data-v-c47feaaa" size="mini" bindtap="{{item.h}}">编辑</button><button class="data-v-c47feaaa" size="mini" type="warn" bindtap="{{item.i}}">删除</button><button class="data-v-c47feaaa" size="mini" disabled="{{item.j}}" bindtap="{{item.k}}">设为默认</button></view></view></view>
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-c47feaaa { padding: 24rpx
|
|
||||||
}
|
|
||||||
.header.data-v-c47feaaa { display: flex; justify-content: flex-end; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.add.data-v-c47feaaa { font-size: 28rpx
|
|
||||||
}
|
|
||||||
.addr.data-v-c47feaaa { background: #fff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.addr-row.data-v-c47feaaa { display: flex; align-items: center; margin-bottom: 8rpx
|
|
||||||
}
|
|
||||||
.name.data-v-c47feaaa { font-size: 30rpx; margin-right: 12rpx
|
|
||||||
}
|
|
||||||
.phone.data-v-c47feaaa { font-size: 28rpx; color: #666
|
|
||||||
}
|
|
||||||
.default.data-v-c47feaaa { font-size: 24rpx; color: #007AFF; margin-left: 10rpx
|
|
||||||
}
|
|
||||||
.region.data-v-c47feaaa { font-size: 26rpx; color: #666
|
|
||||||
}
|
|
||||||
.detail.data-v-c47feaaa { font-size: 26rpx; color: #333
|
|
||||||
}
|
|
||||||
.addr-actions.data-v-c47feaaa { display: flex; justify-content: flex-end; gap: 12rpx; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.empty.data-v-c47feaaa { text-align: center; color: #999; margin-top: 40rpx
|
|
||||||
}
|
|
||||||
.error.data-v-c47feaaa { color: #e43; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5512f5e4"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/agreement/purchase.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "购买协议",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<scroll-view class="page data-v-5512f5e4" scroll-y><view class="h1 data-v-5512f5e4">购买协议</view><view class="meta data-v-5512f5e4">生效日期:2025年11月18日</view><view class="meta data-v-5512f5e4">运营方:【公司全称】</view><view class="p data-v-5512f5e4">本《购买协议》适用于您在【您的小程序名称】(以下简称“本平台”)购买盲盒商品的行为。当您点击“立即购买”并完成支付时,即视为您已阅读、理解并同意本协议全部内容。</view><view class="h2 data-v-5512f5e4">一、商品说明</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">盲盒特性:本平台所售盲盒为系列化商品,包装外观一致,内部款式随机,具体款式无法提前指定或预知。</view><view class="li data-v-5512f5e4">概率公示:各款式(含隐藏款、特殊款)的抽取概率已在商品详情页明确公示,确保透明公正。</view><view class="li data-v-5512f5e4">商品展示:页面图片、描述仅供参考,实际商品以实物为准。</view></view><view class="h2 data-v-5512f5e4">二、购买规则</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">购买资格:仅限已注册并通过身份验证的用户购买。</view><view class="li data-v-5512f5e4">支付方式:支持微信支付等平台认可的支付方式,支付成功即视为订单成立。</view></view><view class="h2 data-v-5512f5e4">三、发货与物流</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">发货时效:发货订单提交成功后,本平台将在3-15个工作日内安排发货(预售商品按页面说明执行)。</view><view class="li data-v-5512f5e4">物流信息:您可在“我的订单”中查看物流状态。因地址错误、联系不畅导致的配送失败,责任由您承担。</view></view><view class="h2 data-v-5512f5e4">四、售后服务</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">质量问题(如商品破损、漏发、错发、非盲盒系列商品):请在签收后2到4小时内联系客服并提供凭证(如开箱视频、照片);经核实后,平台将为您补发、换货或退款。</view><view class="li data-v-5512f5e4">非质量问题(如抽中重复款式、不喜欢款式、未抽中隐藏款等):不支持无理由退换货。</view><view class="li data-v-5512f5e4">拆封后商品:出于卫生与二次销售考虑,已拆封盲盒恕不退换(质量问题除外)。</view></view><view class="h2 data-v-5512f5e4">五、价格与促销</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">商品价格以页面实时显示为准,平台有权根据市场情况调整价格。</view><view class="li data-v-5512f5e4">优惠券、折扣活动需遵守对应规则,不可叠加或兑现。</view></view><view class="h2 data-v-5512f5e4">六、特别提示</view><view class="ol data-v-5512f5e4"><view class="li data-v-5512f5e4">盲盒不具备投资属性,本平台不承诺保值、升值或回购。</view><view class="li data-v-5512f5e4">隐藏款抽取属小概率事件,请勿抱有赌博心态,理性消费。</view></view><view class="h2 data-v-5512f5e4">七、免责情形</view><view class="ul data-v-5512f5e4"><view class="li data-v-5512f5e4">因不可抗力导致无法发货或延迟;</view><view class="li data-v-5512f5e4">用户提供错误收货信息;</view><view class="li data-v-5512f5e4">因第三方物流原因造成的商品损毁或丢失(平台将协助索赔)。</view></view><view class="h2 data-v-5512f5e4">八、协议效力</view><view class="p data-v-5512f5e4">本购买协议为《用户协议》的补充,两者冲突时,以本协议中关于交易的条款为准。未尽事宜,依照《消费者权益保护法》《电子商务法》等法律法规执行。</view><view class="h2 data-v-5512f5e4">九、联系我们</view><view class="p data-v-5512f5e4">售后专线:service@yourdomain.com</view><view class="p data-v-5512f5e4">工作时间:工作日 9:00–18:00</view><view class="p data-v-5512f5e4">运营主体:【公司全称】</view><view class="p data-v-5512f5e4">统一社会信用代码:【XXXXXXXXXXXXXX】</view><view class="tip data-v-5512f5e4">理性消费提醒:盲盒是一种娱乐消费形式,请根据自身经济能力合理购买,切勿沉迷或过度投入。</view></scroll-view>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-5512f5e4 { height: 100vh
|
|
||||||
}
|
|
||||||
.h1.data-v-5512f5e4 { font-size: 36rpx; font-weight: 700; padding: 24rpx
|
|
||||||
}
|
|
||||||
.meta.data-v-5512f5e4 { padding: 0 24rpx; font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
.h2.data-v-5512f5e4 { font-size: 30rpx; font-weight: 600; padding: 20rpx 24rpx 8rpx
|
|
||||||
}
|
|
||||||
.p.data-v-5512f5e4 { padding: 0 24rpx; font-size: 26rpx; line-height: 1.6
|
|
||||||
}
|
|
||||||
.ul.data-v-5512f5e4, .ol.data-v-5512f5e4 { padding: 0 24rpx
|
|
||||||
}
|
|
||||||
.ul .li.data-v-5512f5e4, .ol .li.data-v-5512f5e4 { font-size: 26rpx; line-height: 1.6; margin: 8rpx 0
|
|
||||||
}
|
|
||||||
.tip.data-v-5512f5e4 { padding: 16rpx 24rpx; font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ff1e87b4"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/agreement/user.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "用户协议",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<scroll-view class="page data-v-ff1e87b4" scroll-y><view class="h1 data-v-ff1e87b4">用户协议</view><view class="meta data-v-ff1e87b4">生效日期:2025年11月18日</view><view class="meta data-v-ff1e87b4">运营方:【公司全称】</view><view class="p data-v-ff1e87b4">欢迎您使用【您的小程序名称】(以下简称“本平台”)提供的服务。请您在注册、登录或使用本平台前,认真阅读并充分理解本《用户协议》(以下简称“本协议”)。一旦您完成注册、登录或以任何方式使用本平台服务,即视为您已完全接受本协议全部条款。如您不同意,请勿使用本平台。</view><view class="h2 data-v-ff1e87b4">一、协议范围</view><view class="p data-v-ff1e87b4">本协议规范您作为用户在本平台注册、浏览、互动、参与活动等行为,是您与本平台之间的基本权利义务约定。</view><view class="h2 data-v-ff1e87b4">二、用户资格</view><view class="ol data-v-ff1e87b4"><view class="li data-v-ff1e87b4">您须为年满18周岁的自然人,具备完全民事行为能力。</view><view class="li data-v-ff1e87b4">未成年人如需使用本平台,须在法定监护人知情并同意下进行,监护人应承担相应责任。</view></view><view class="h2 data-v-ff1e87b4">三、账号与安全</view><view class="ol data-v-ff1e87b4"><view class="li data-v-ff1e87b4">您应提供真实、准确、完整的注册信息,并对账号下的一切行为负责。</view><view class="li data-v-ff1e87b4">请妥善保管账号密码,因泄露、出借或被盗用造成的损失由您自行承担。</view></view><view class="h2 data-v-ff1e87b4">四、用户行为规范</view><view class="p data-v-ff1e87b4">您承诺不从事以下行为:</view><view class="ul data-v-ff1e87b4"><view class="li data-v-ff1e87b4">发布违法、侵权、色情、暴力或虚假信息;</view><view class="li data-v-ff1e87b4">利用技术手段干扰系统正常运行(如刷量、外挂、爬虫);</view><view class="li data-v-ff1e87b4">恶意投诉、敲诈勒索或损害平台商誉;</view><view class="li data-v-ff1e87b4">转售账号或用于商业牟利(除非平台明确授权)。</view></view><view class="h2 data-v-ff1e87b4">五、隐私保护</view><view class="p data-v-ff1e87b4">我们尊重并保护您的个人信息。关于数据收集、使用及保护的具体规则,请参见《隐私政策》(链接)。未经您同意,我们不会向第三方共享您的个人信息,法律法规另有规定除外。</view><view class="h2 data-v-ff1e87b4">六、知识产权</view><view class="ol data-v-ff1e87b4"><view class="li data-v-ff1e87b4">本平台所有内容(包括但不限于界面设计、文字、图片、盲盒形象、LOGO)的知识产权归本平台或其许可方所有。</view><view class="li data-v-ff1e87b4">未经书面授权,您不得复制、传播、修改或用于商业用途。</view></view><view class="h2 data-v-ff1e87b4">七、免责条款</view><view class="ol data-v-ff1e87b4"><view class="li data-v-ff1e87b4">因不可抗力(如地震、网络攻击、政府行为)导致服务中断,本平台不承担责任。</view><view class="li data-v-ff1e87b4">您因违反本协议造成自身或第三方损失的,由您自行承担。</view></view><view class="h2 data-v-ff1e87b4">八、协议变更与终止</view><view class="ol data-v-ff1e87b4"><view class="li data-v-ff1e87b4">本平台有权根据业务或法律变化修订本协议,修订后将通过公告或推送通知您。继续使用即视为接受新条款。</view><view class="li data-v-ff1e87b4">您可随时注销账号终止使用;平台有权对违规账号采取限制或封禁措施。</view></view><view class="h2 data-v-ff1e87b4">九、法律适用与争议解决</view><view class="p data-v-ff1e87b4">本协议适用中华人民共和国法律。因本协议引起的争议,双方应协商解决;协商不成的,提交本平台运营方所在地有管辖权的人民法院诉讼解决。</view><view class="h2 data-v-ff1e87b4">十、联系我们</view><view class="p data-v-ff1e87b4">客服邮箱:service@yourdomain.com</view><view class="p data-v-ff1e87b4">客服电话:400-XXX-XXXX(工作日 9:00–18:00)</view><view class="p data-v-ff1e87b4">运营主体:【公司全称】</view><view class="p data-v-ff1e87b4">地址:【公司注册地址】</view><view class="tip data-v-ff1e87b4">温馨提示:盲盒具有随机性和娱乐性,请理性参与,避免沉迷。未成年人禁止参与购买。</view></scroll-view>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-ff1e87b4 { height: 100vh
|
|
||||||
}
|
|
||||||
.h1.data-v-ff1e87b4 { font-size: 36rpx; font-weight: 700; padding: 24rpx
|
|
||||||
}
|
|
||||||
.meta.data-v-ff1e87b4 { padding: 0 24rpx; font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
.h2.data-v-ff1e87b4 { font-size: 30rpx; font-weight: 600; padding: 20rpx 24rpx 8rpx
|
|
||||||
}
|
|
||||||
.p.data-v-ff1e87b4 { padding: 0 24rpx; font-size: 26rpx; line-height: 1.6
|
|
||||||
}
|
|
||||||
.ul.data-v-ff1e87b4, .ol.data-v-ff1e87b4 { padding: 0 24rpx
|
|
||||||
}
|
|
||||||
.ul .li.data-v-ff1e87b4, .ol .li.data-v-ff1e87b4 { font-size: 26rpx; line-height: 1.6; margin: 8rpx 0
|
|
||||||
}
|
|
||||||
.tip.data-v-ff1e87b4 { padding: 16rpx 24rpx; font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
common_vendor.index.__f__("log", "at pages/cabinet/index.vue:10", "cabinet onShow token:", token, "isLogin:", !!token, "phoneBound:", phoneBound);
|
|
||||||
if (!token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return {};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-814d09c7"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cabinet/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "货柜",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-814d09c7">货柜</view>
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-814d09c7 { padding: 40rpx
|
|
||||||
}
|
|
||||||
21
unpackage/dist/dev/mp-weixin/pages/help/index.js
vendored
@ -1,21 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
methods: {
|
|
||||||
toUser() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/agreement/user" });
|
|
||||||
},
|
|
||||||
toPurchase() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/agreement/purchase" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return {
|
|
||||||
a: common_vendor.o((...args) => $options.toUser && $options.toUser(...args)),
|
|
||||||
b: common_vendor.o((...args) => $options.toPurchase && $options.toPurchase(...args))
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e6af2099"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/help/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "使用帮助",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-e6af2099"><view class="card data-v-e6af2099" bindtap="{{a}}"><view class="title data-v-e6af2099">用户协议</view><view class="desc data-v-e6af2099">查看平台使用条款与隐私说明</view></view><view class="card data-v-e6af2099" bindtap="{{b}}"><view class="title data-v-e6af2099">购买协议</view><view class="desc data-v-e6af2099">查看盲盒购买规则与售后政策</view></view></view>
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-e6af2099 { padding: 24rpx
|
|
||||||
}
|
|
||||||
.card.data-v-e6af2099 { background: #fff; border-radius: 12rpx; padding: 24rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.title.data-v-e6af2099 { font-size: 30rpx; font-weight: 600
|
|
||||||
}
|
|
||||||
.desc.data-v-e6af2099 { margin-top: 8rpx; font-size: 24rpx; color: #666
|
|
||||||
}
|
|
||||||
224
unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
@ -1,224 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const utils_request = require("../../utils/request.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
notices: [],
|
|
||||||
banners: [],
|
|
||||||
activities: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
displayNotices() {
|
|
||||||
if (Array.isArray(this.notices) && this.notices.length)
|
|
||||||
return this.notices;
|
|
||||||
return [
|
|
||||||
{ id: "n1", text: "欢迎光临" },
|
|
||||||
{ id: "n2", text: "最新活动敬请期待" }
|
|
||||||
];
|
|
||||||
},
|
|
||||||
displayBanners() {
|
|
||||||
if (Array.isArray(this.banners) && this.banners.length)
|
|
||||||
return this.banners;
|
|
||||||
return [
|
|
||||||
{ id: "ph-1", title: "精彩内容即将上线", image: "" },
|
|
||||||
{ id: "ph-2", title: "敬请期待", image: "" },
|
|
||||||
{ id: "ph-3", title: "更多活动请关注", image: "" }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:81", "home onShow", { token: !!token, phoneBound });
|
|
||||||
} catch (_) {
|
|
||||||
}
|
|
||||||
this.loadHomeData();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toArray(x) {
|
|
||||||
return Array.isArray(x) ? x : [];
|
|
||||||
},
|
|
||||||
unwrap(list) {
|
|
||||||
if (Array.isArray(list))
|
|
||||||
return list;
|
|
||||||
const obj = list || {};
|
|
||||||
const arr = obj.list || obj.items || obj.data || [];
|
|
||||||
return Array.isArray(arr) ? arr : [];
|
|
||||||
},
|
|
||||||
cleanUrl(u) {
|
|
||||||
const s = String(u || "").trim();
|
|
||||||
const m = s.match(/https?:\/\/[^\s'"`]+/);
|
|
||||||
if (m && m[0])
|
|
||||||
return m[0];
|
|
||||||
return s.replace(/[`'\"]/g, "").trim();
|
|
||||||
},
|
|
||||||
apiGet(url) {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const fn = token ? utils_request.authRequest : utils_request.request;
|
|
||||||
return fn({ url });
|
|
||||||
},
|
|
||||||
normalizeNotices(list) {
|
|
||||||
const arr = this.unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
text: i.content ?? i.text ?? i.title ?? ""
|
|
||||||
})).filter((i) => i.text);
|
|
||||||
},
|
|
||||||
normalizeBanners(list) {
|
|
||||||
const arr = this.unwrap(list);
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:112", "normalizeBanners input", list, "unwrapped", arr);
|
|
||||||
const mapped = arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
title: i.title ?? "",
|
|
||||||
image: this.cleanUrl(i.imageUrl ?? i.image_url ?? i.image ?? i.img ?? i.pic ?? ""),
|
|
||||||
link: this.cleanUrl(i.linkUrl ?? i.link_url ?? i.link ?? i.url ?? ""),
|
|
||||||
sort: typeof i.sort === "number" ? i.sort : 0
|
|
||||||
})).filter((i) => i.image);
|
|
||||||
mapped.sort((a, b) => a.sort - b.sort);
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:121", "normalizeBanners mapped", mapped);
|
|
||||||
return mapped;
|
|
||||||
},
|
|
||||||
normalizeActivities(list) {
|
|
||||||
const arr = this.unwrap(list);
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:126", "normalizeActivities input", list, "unwrapped", arr);
|
|
||||||
const mapped = arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? String(idx),
|
|
||||||
image: this.cleanUrl(i.banner ?? i.coverUrl ?? i.cover_url ?? i.image ?? i.img ?? i.pic ?? ""),
|
|
||||||
title: i.title ?? i.name ?? "",
|
|
||||||
subtitle: this.buildActivitySubtitle(i),
|
|
||||||
link: this.cleanUrl(i.linkUrl ?? i.link_url ?? i.link ?? i.url ?? ""),
|
|
||||||
category_name: (i.category_name ?? i.categoryName ?? "").trim(),
|
|
||||||
category_id: i.activity_category_id ?? i.category_id ?? i.categoryId ?? null
|
|
||||||
})).filter((i) => i.image || i.title);
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:136", "normalizeActivities mapped", mapped);
|
|
||||||
return mapped;
|
|
||||||
},
|
|
||||||
buildActivitySubtitle(i) {
|
|
||||||
const base = i.subTitle ?? i.sub_title ?? i.subtitle ?? i.desc ?? i.description ?? "";
|
|
||||||
if (base)
|
|
||||||
return base;
|
|
||||||
const cat = i.category_name ?? i.categoryName ?? "";
|
|
||||||
const price = i.price_draw !== void 0 && i.price_draw !== null ? `¥${i.price_draw}` : "";
|
|
||||||
const parts = [cat, price].filter(Boolean);
|
|
||||||
return parts.join(" · ");
|
|
||||||
},
|
|
||||||
async loadHomeData() {
|
|
||||||
const results = await Promise.allSettled([
|
|
||||||
this.apiGet("/api/app/notices"),
|
|
||||||
this.apiGet("/api/app/banners"),
|
|
||||||
this.apiGet("/api/app/activities")
|
|
||||||
]);
|
|
||||||
const [nRes, bRes, acRes] = results;
|
|
||||||
if (nRes.status === "fulfilled") {
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:155", "notices ok", nRes.value);
|
|
||||||
this.notices = this.normalizeNotices(nRes.value);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.__f__("error", "at pages/index/index.vue:158", "notices error", nRes.reason);
|
|
||||||
this.notices = [];
|
|
||||||
}
|
|
||||||
if (bRes.status === "fulfilled") {
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:162", "banners ok", bRes.value);
|
|
||||||
this.banners = this.normalizeBanners(bRes.value);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.__f__("error", "at pages/index/index.vue:165", "banners error", bRes.reason);
|
|
||||||
this.banners = [];
|
|
||||||
}
|
|
||||||
if (acRes.status === "fulfilled") {
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:169", "activities ok", acRes.value);
|
|
||||||
this.activities = this.normalizeActivities(acRes.value);
|
|
||||||
} else {
|
|
||||||
common_vendor.index.__f__("error", "at pages/index/index.vue:172", "activities error", acRes.reason);
|
|
||||||
this.activities = [];
|
|
||||||
}
|
|
||||||
common_vendor.index.__f__("log", "at pages/index/index.vue:175", "home normalized", { notices: this.notices, banners: this.banners, activities: this.activities });
|
|
||||||
},
|
|
||||||
onBannerTap(b) {
|
|
||||||
const imgs = (Array.isArray(this.banners) ? this.banners : []).map((x) => x.image).filter(Boolean);
|
|
||||||
const current = b && b.image;
|
|
||||||
if (current) {
|
|
||||||
common_vendor.index.previewImage({ urls: imgs.length ? imgs : [current], current });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (b.link && /^\/.+/.test(b.link)) {
|
|
||||||
common_vendor.index.navigateTo({ url: b.link });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onActivityTap(a) {
|
|
||||||
const name = (a.category_name || a.categoryName || "").trim();
|
|
||||||
const id = a.id;
|
|
||||||
let path = "";
|
|
||||||
if (name === "一番赏")
|
|
||||||
path = "/pages/activity/yifanshang/index";
|
|
||||||
else if (name === "无限赏")
|
|
||||||
path = "/pages/activity/wuxianshang/index";
|
|
||||||
else if (name === "对对碰")
|
|
||||||
path = "/pages/activity/duiduipeng/index";
|
|
||||||
if (path && id) {
|
|
||||||
common_vendor.index.navigateTo({ url: `${path}?id=${id}` });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (a.link && /^\/.+/.test(a.link)) {
|
|
||||||
common_vendor.index.navigateTo({ url: a.link });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_vendor.f($options.displayNotices, (n, k0, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(n.text),
|
|
||||||
b: n.id
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
b: common_vendor.f($options.displayBanners, (b, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: b.image
|
|
||||||
}, b.image ? {
|
|
||||||
b: b.image,
|
|
||||||
c: common_vendor.o(($event) => $options.onBannerTap(b), b.id)
|
|
||||||
} : {
|
|
||||||
d: common_vendor.t(b.title || "敬请期待")
|
|
||||||
}, {
|
|
||||||
e: b.id
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
c: $data.activities.length
|
|
||||||
}, $data.activities.length ? {
|
|
||||||
d: common_vendor.f($data.activities, (a, k0, i0) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: a.image
|
|
||||||
}, a.image ? {
|
|
||||||
b: a.image
|
|
||||||
} : {
|
|
||||||
c: common_vendor.t(a.title || "活动敬请期待")
|
|
||||||
}, {
|
|
||||||
d: common_vendor.t(a.title),
|
|
||||||
e: a.subtitle
|
|
||||||
}, a.subtitle ? {
|
|
||||||
f: common_vendor.t(a.subtitle)
|
|
||||||
} : {}, {
|
|
||||||
g: a.id,
|
|
||||||
h: common_vendor.o(($event) => $options.onActivityTap(a), a.id)
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} : {});
|
|
||||||
}
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "uni-app",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="page"><view class="notice-bar"><swiper class="notice-swiper" vertical circular autoplay interval="3000" duration="300"><swiper-item wx:for="{{a}}" wx:for-item="n" wx:key="b"><view class="notice-item">{{n.a}}</view></swiper-item></swiper></view><view class="banner-box"><swiper class="banner-swiper" circular autoplay interval="4000" duration="500"><swiper-item wx:for="{{b}}" wx:for-item="b" wx:key="e"><image wx:if="{{b.a}}" class="banner-image" src="{{b.b}}" mode="aspectFill" bindtap="{{b.c}}"/><view wx:else class="banner-fallback"><text class="banner-fallback-text">{{b.d}}</text></view></swiper-item></swiper></view><view class="activity-section"><view class="section-title">活动</view><view wx:if="{{c}}" class="activity-grid"><view wx:for="{{d}}" wx:for-item="a" wx:key="g" class="activity-item" bindtap="{{a.h}}"><image wx:if="{{a.a}}" class="activity-thumb" src="{{a.b}}" mode="aspectFill"/><view wx:else class="banner-fallback"><text class="banner-fallback-text">{{a.c}}</text></view><text class="activity-name">{{a.d}}</text><text wx:if="{{a.e}}" class="activity-desc">{{a.f}}</text></view></view><view wx:else class="activity-empty">暂无活动</view></view></view>
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
|
|
||||||
.page { padding: 24rpx
|
|
||||||
}
|
|
||||||
.notice-bar { height: 64rpx; background: #fff4e6; border-radius: 8rpx; overflow: hidden; margin-bottom: 24rpx;
|
|
||||||
}
|
|
||||||
.notice-swiper { height: 64rpx
|
|
||||||
}
|
|
||||||
.notice-item { height: 64rpx; line-height: 64rpx; padding: 0 24rpx; color: #a15c00; font-size: 26rpx
|
|
||||||
}
|
|
||||||
.banner-box { margin-bottom: 24rpx
|
|
||||||
}
|
|
||||||
.banner-swiper { width: 100%; height: 320rpx; border-radius: 12rpx; overflow: hidden
|
|
||||||
}
|
|
||||||
.banner-image { width: 100%; height: 320rpx
|
|
||||||
}
|
|
||||||
.banner-fallback { width: 100%; height: 320rpx; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f5f5f5, #eaeaea)
|
|
||||||
}
|
|
||||||
.banner-fallback-text { color: #666; font-size: 28rpx
|
|
||||||
}
|
|
||||||
.activity-section { background: #ffffff; border-radius: 12rpx; padding: 24rpx
|
|
||||||
}
|
|
||||||
.section-title { font-size: 30rpx; font-weight: 600; margin-bottom: 16rpx
|
|
||||||
}
|
|
||||||
.activity-grid { display: flex; flex-wrap: wrap; margin: -12rpx
|
|
||||||
}
|
|
||||||
.activity-item { width: 50%; padding: 12rpx
|
|
||||||
}
|
|
||||||
.activity-thumb { width: 100%; height: 200rpx; border-radius: 8rpx
|
|
||||||
}
|
|
||||||
.activity-name { display: block; margin-top: 8rpx; font-size: 26rpx; color: #222
|
|
||||||
}
|
|
||||||
.activity-desc { display: block; margin-top: 4rpx; font-size: 22rpx; color: #888
|
|
||||||
}
|
|
||||||
136
unpackage/dist/dev/mp-weixin/pages/login/index.js
vendored
@ -1,136 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const common_assets = require("../../common/assets.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
const needBindPhone = common_vendor.ref(false);
|
|
||||||
common_vendor.computed(() => !!common_vendor.index.getStorageSync("token"));
|
|
||||||
function toUserAgreement() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/agreement/user" });
|
|
||||||
}
|
|
||||||
function toPurchaseAgreement() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/agreement/purchase" });
|
|
||||||
}
|
|
||||||
function onGetPhoneNumber(e) {
|
|
||||||
const phoneCode = e.detail.code;
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:37", "login_flow start getPhoneNumber, codeExists:", !!phoneCode);
|
|
||||||
if (!phoneCode) {
|
|
||||||
common_vendor.index.showToast({ title: "未授权手机号", icon: "none" });
|
|
||||||
common_vendor.index.__f__("error", "at pages/login/index.vue:40", "login_flow error: missing phoneCode");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loading.value = true;
|
|
||||||
error.value = "";
|
|
||||||
common_vendor.index.login({
|
|
||||||
provider: "weixin",
|
|
||||||
success: async (res) => {
|
|
||||||
try {
|
|
||||||
const loginCode = res.code;
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:50", "login_flow uni.login success, loginCode exists:", !!loginCode);
|
|
||||||
const data = await api_appUser.wechatLogin(loginCode);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:52", "login_flow wechatLogin response user_id:", data && data.user_id);
|
|
||||||
const token = data && data.token;
|
|
||||||
const user_id = data && data.user_id;
|
|
||||||
const avatar = data && data.avatar;
|
|
||||||
const nickname = data && data.nickname;
|
|
||||||
const invite_code = data && data.invite_code;
|
|
||||||
common_vendor.index.setStorageSync("user_info", data || {});
|
|
||||||
if (token) {
|
|
||||||
common_vendor.index.setStorageSync("token", token);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:61", "login_flow token stored");
|
|
||||||
}
|
|
||||||
if (user_id) {
|
|
||||||
common_vendor.index.setStorageSync("user_id", user_id);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:65", "login_flow user_id stored:", user_id);
|
|
||||||
}
|
|
||||||
if (avatar) {
|
|
||||||
common_vendor.index.setStorageSync("avatar", avatar);
|
|
||||||
}
|
|
||||||
if (nickname) {
|
|
||||||
common_vendor.index.setStorageSync("nickname", nickname);
|
|
||||||
}
|
|
||||||
if (invite_code) {
|
|
||||||
common_vendor.index.setStorageSync("invite_code", invite_code);
|
|
||||||
}
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:76", "login_flow bindPhone start");
|
|
||||||
try {
|
|
||||||
await new Promise((r) => setTimeout(r, 600));
|
|
||||||
const bindRes = await api_appUser.bindPhone(user_id, phoneCode, { "X-Suppress-Auth-Modal": true });
|
|
||||||
const phoneNumber = bindRes && (bindRes.phone || bindRes.phone_number || bindRes.mobile) || "";
|
|
||||||
if (phoneNumber)
|
|
||||||
common_vendor.index.setStorageSync("phone_number", phoneNumber);
|
|
||||||
} catch (bindErr) {
|
|
||||||
if (bindErr && bindErr.statusCode === 401) {
|
|
||||||
common_vendor.index.__f__("warn", "at pages/login/index.vue:85", "login_flow bindPhone 401, try re-login and retry");
|
|
||||||
const relogin = await new Promise((resolve, reject) => {
|
|
||||||
common_vendor.index.login({ provider: "weixin", success: resolve, fail: reject });
|
|
||||||
});
|
|
||||||
const data2 = await api_appUser.wechatLogin(relogin.code);
|
|
||||||
const token2 = data2 && data2.token;
|
|
||||||
const user2 = data2 && data2.user_id;
|
|
||||||
if (token2)
|
|
||||||
common_vendor.index.setStorageSync("token", token2);
|
|
||||||
if (user2)
|
|
||||||
common_vendor.index.setStorageSync("user_id", user2);
|
|
||||||
await new Promise((r) => setTimeout(r, 600));
|
|
||||||
const bindRes2 = await api_appUser.bindPhone(user2 || user_id, phoneCode, { "X-Suppress-Auth-Modal": true });
|
|
||||||
const phoneNumber2 = bindRes2 && (bindRes2.phone || bindRes2.phone_number || bindRes2.mobile) || "";
|
|
||||||
if (phoneNumber2)
|
|
||||||
common_vendor.index.setStorageSync("phone_number", phoneNumber2);
|
|
||||||
} else {
|
|
||||||
throw bindErr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.index.setStorageSync("phone_bound", true);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:105", "login_flow bindPhone success, phone_bound stored");
|
|
||||||
try {
|
|
||||||
const stats = await api_appUser.getUserStats(user_id);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:108", "login_flow getUserStats success");
|
|
||||||
const balance = await api_appUser.getPointsBalance(user_id);
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:110", "login_flow getPointsBalance success");
|
|
||||||
common_vendor.index.setStorageSync("user_stats", stats);
|
|
||||||
const b = balance && balance.balance !== void 0 ? balance.balance : balance;
|
|
||||||
common_vendor.index.setStorageSync("points_balance", b);
|
|
||||||
} catch (e2) {
|
|
||||||
common_vendor.index.__f__("error", "at pages/login/index.vue:115", "login_flow fetch stats/points error:", e2 && (e2.message || e2.errMsg));
|
|
||||||
}
|
|
||||||
common_vendor.index.showToast({ title: "登录并绑定成功", icon: "success" });
|
|
||||||
common_vendor.index.__f__("log", "at pages/login/index.vue:118", "login_flow navigate to index");
|
|
||||||
common_vendor.index.reLaunch({ url: "/pages/index/index" });
|
|
||||||
} catch (err) {
|
|
||||||
common_vendor.index.__f__("error", "at pages/login/index.vue:121", "login_flow error:", err && (err.message || err.errMsg), "status:", err && err.statusCode);
|
|
||||||
error.value = err.message || "登录或绑定失败";
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (e2) => {
|
|
||||||
common_vendor.index.__f__("error", "at pages/login/index.vue:128", "login_flow uni.login fail:", e2 && e2.errMsg);
|
|
||||||
error.value = "微信登录失败";
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: common_assets._imports_0,
|
|
||||||
b: loading.value,
|
|
||||||
c: common_vendor.o(onGetPhoneNumber),
|
|
||||||
d: common_vendor.o(toUserAgreement),
|
|
||||||
e: common_vendor.o(toPurchaseAgreement),
|
|
||||||
f: needBindPhone.value
|
|
||||||
}, needBindPhone.value ? {} : {}, {
|
|
||||||
g: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
h: common_vendor.t(error.value)
|
|
||||||
} : {});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d08ef7d4"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "登录",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="container data-v-d08ef7d4"><image class="logo data-v-d08ef7d4" src="{{a}}" mode="widthFix"></image><view class="title data-v-d08ef7d4">微信登录</view><button class="btn data-v-d08ef7d4" open-type="getPhoneNumber" disabled="{{b}}" bindgetphonenumber="{{c}}">授权手机号快速登录</button><view class="agreements data-v-d08ef7d4"><text class="data-v-d08ef7d4">注册或登录即表示您已阅读并同意</text><text class="link data-v-d08ef7d4" bindtap="{{d}}">《用户协议》</text><text class="data-v-d08ef7d4">和</text><text class="link data-v-d08ef7d4" bindtap="{{e}}">《购买协议》</text></view><view wx:if="{{f}}" class="tip data-v-d08ef7d4">登录成功,请绑定手机号以完成登录</view><view wx:if="{{g}}" class="error data-v-d08ef7d4">{{h}}</view></view>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
.container.data-v-d08ef7d4 { padding: 40rpx; display: flex; flex-direction: column; align-items: center
|
|
||||||
}
|
|
||||||
.logo.data-v-d08ef7d4 { width: 200rpx; margin-top: 100rpx; margin-bottom: 40rpx
|
|
||||||
}
|
|
||||||
.title.data-v-d08ef7d4 { font-size: 36rpx; margin-bottom: 20rpx
|
|
||||||
}
|
|
||||||
.btn.data-v-d08ef7d4 { width: 80%; margin-top: 20rpx
|
|
||||||
}
|
|
||||||
.agreements.data-v-d08ef7d4 { margin-top: 16rpx; font-size: 24rpx; color: #666; display: flex; flex-wrap: wrap; justify-content: center
|
|
||||||
}
|
|
||||||
.link.data-v-d08ef7d4 { color: #007AFF; margin: 0 6rpx
|
|
||||||
}
|
|
||||||
.tip.data-v-d08ef7d4 { color: #666; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.error.data-v-d08ef7d4 { color: #e43; margin-top: 20rpx
|
|
||||||
}
|
|
||||||
105
unpackage/dist/dev/mp-weixin/pages/mine/index.js
vendored
@ -1,105 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const avatar = common_vendor.ref(common_vendor.index.getStorageSync("avatar") || "");
|
|
||||||
const nickname = common_vendor.ref(common_vendor.index.getStorageSync("nickname") || "");
|
|
||||||
const userId = common_vendor.ref(common_vendor.index.getStorageSync("user_id") || "");
|
|
||||||
const phoneNumber = common_vendor.ref(common_vendor.index.getStorageSync("phone_number") || "");
|
|
||||||
const inviteCode = common_vendor.ref(common_vendor.index.getStorageSync("invite_code") || (common_vendor.index.getStorageSync("user_info") || {}).invite_code || "");
|
|
||||||
const pointsBalance = common_vendor.ref(common_vendor.index.getStorageSync("points_balance") || 0);
|
|
||||||
const stats = common_vendor.ref(common_vendor.index.getStorageSync("user_stats") || {});
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
async function refresh() {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
loading.value = true;
|
|
||||||
error.value = "";
|
|
||||||
try {
|
|
||||||
const s = await api_appUser.getUserStats(user_id);
|
|
||||||
stats.value = s || {};
|
|
||||||
common_vendor.index.setStorageSync("user_stats", stats.value);
|
|
||||||
const b = await api_appUser.getPointsBalance(user_id);
|
|
||||||
const balance = b && b.balance !== void 0 ? b.balance : b;
|
|
||||||
pointsBalance.value = balance || 0;
|
|
||||||
common_vendor.index.setStorageSync("points_balance", pointsBalance.value);
|
|
||||||
} catch (e) {
|
|
||||||
error.value = e && (e.message || e.errMsg) || "数据获取失败";
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function toPoints() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/points/index" });
|
|
||||||
}
|
|
||||||
function toOrders(status) {
|
|
||||||
const s = status === "completed" ? "completed" : "pending";
|
|
||||||
common_vendor.index.navigateTo({ url: `/pages/orders/index?status=${s}` });
|
|
||||||
}
|
|
||||||
function toAddresses() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/address/index" });
|
|
||||||
}
|
|
||||||
function toHelp() {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/help/index" });
|
|
||||||
}
|
|
||||||
common_vendor.onShow(() => {
|
|
||||||
avatar.value = common_vendor.index.getStorageSync("avatar") || avatar.value;
|
|
||||||
nickname.value = common_vendor.index.getStorageSync("nickname") || nickname.value;
|
|
||||||
userId.value = common_vendor.index.getStorageSync("user_id") || userId.value;
|
|
||||||
phoneNumber.value = common_vendor.index.getStorageSync("phone_number") || phoneNumber.value;
|
|
||||||
const ui = common_vendor.index.getStorageSync("user_info") || {};
|
|
||||||
inviteCode.value = common_vendor.index.getStorageSync("invite_code") || ui.invite_code || inviteCode.value;
|
|
||||||
pointsBalance.value = common_vendor.index.getStorageSync("points_balance") || pointsBalance.value;
|
|
||||||
const s = common_vendor.index.getStorageSync("user_stats");
|
|
||||||
if (s)
|
|
||||||
stats.value = s;
|
|
||||||
refresh();
|
|
||||||
});
|
|
||||||
common_vendor.onLoad(() => {
|
|
||||||
refresh();
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: avatar.value || "/static/logo.png",
|
|
||||||
b: common_vendor.t(nickname.value || "未登录"),
|
|
||||||
c: common_vendor.t(userId.value || "-"),
|
|
||||||
d: common_vendor.t(phoneNumber.value || "未绑定"),
|
|
||||||
e: common_vendor.t(inviteCode.value || "-"),
|
|
||||||
f: common_vendor.o(toPoints),
|
|
||||||
g: common_vendor.t(pointsBalance.value),
|
|
||||||
h: common_vendor.t(stats.value.coupon_count || 0),
|
|
||||||
i: common_vendor.t(stats.value.item_card_count || 0),
|
|
||||||
j: common_vendor.o(refresh),
|
|
||||||
k: loading.value,
|
|
||||||
l: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
m: common_vendor.t(error.value)
|
|
||||||
} : {}, {
|
|
||||||
n: common_vendor.o(($event) => toOrders("pending")),
|
|
||||||
o: common_vendor.o(($event) => toOrders("completed")),
|
|
||||||
p: common_vendor.o(toAddresses),
|
|
||||||
q: common_vendor.o(toHelp)
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-569e925a"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "我的",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-569e925a"><view class="header data-v-569e925a"><image class="avatar data-v-569e925a" src="{{a}}" mode="aspectFill"></image><view class="profile data-v-569e925a"><view class="nickname data-v-569e925a">{{b}}</view><view class="userid data-v-569e925a">ID:{{c}}</view></view></view><view class="info data-v-569e925a"><view class="info-item data-v-569e925a"><text class="info-label data-v-569e925a">手机号</text><text class="info-value data-v-569e925a">{{d}}</text></view><view class="info-item data-v-569e925a"><text class="info-label data-v-569e925a">邀请码</text><text class="info-value data-v-569e925a">{{e}}</text></view></view><view class="stats data-v-569e925a"><view class="stat data-v-569e925a"><view class="stat-label data-v-569e925a" bindtap="{{f}}">积分</view><view class="stat-value data-v-569e925a">{{g}}</view></view><view class="stat data-v-569e925a"><view class="stat-label data-v-569e925a">卡券</view><view class="stat-value data-v-569e925a">{{h}}</view></view><view class="stat data-v-569e925a"><view class="stat-label data-v-569e925a">道具卡</view><view class="stat-value data-v-569e925a">{{i}}</view></view></view><button class="refresh data-v-569e925a" bindtap="{{j}}" disabled="{{k}}">刷新数据</button><view wx:if="{{l}}" class="error data-v-569e925a">{{m}}</view></view><view class="orders data-v-569e925a"><view class="orders-title data-v-569e925a">我的订单</view><view class="orders-cats data-v-569e925a"><view class="orders-cat data-v-569e925a" bindtap="{{n}}"><view class="orders-cat-title data-v-569e925a">待付款</view></view><view class="orders-cat data-v-569e925a" bindtap="{{o}}"><view class="orders-cat-title data-v-569e925a">已完成</view></view></view></view><view class="addresses data-v-569e925a"><view class="addresses-title data-v-569e925a">地址管理</view><view class="addresses-entry data-v-569e925a" bindtap="{{p}}"><text class="addresses-text data-v-569e925a">管理收货地址</text><text class="addresses-arrow data-v-569e925a">›</text></view></view><view class="addresses data-v-569e925a"><view class="addresses-title data-v-569e925a">使用帮助</view><view class="addresses-entry data-v-569e925a" bindtap="{{q}}"><text class="addresses-text data-v-569e925a">查看协议与说明</text><text class="addresses-arrow data-v-569e925a">›</text></view></view>
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-569e925a { padding: 40rpx
|
|
||||||
}
|
|
||||||
.header.data-v-569e925a { display: flex; align-items: center; margin-bottom: 24rpx
|
|
||||||
}
|
|
||||||
.avatar.data-v-569e925a { width: 120rpx; height: 120rpx; border-radius: 60rpx; background-color: #f5f5f5
|
|
||||||
}
|
|
||||||
.profile.data-v-569e925a { margin-left: 20rpx; display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.nickname.data-v-569e925a { font-size: 32rpx
|
|
||||||
}
|
|
||||||
.userid.data-v-569e925a { margin-top: 6rpx; font-size: 24rpx; color: #999
|
|
||||||
}
|
|
||||||
.info.data-v-569e925a { display: flex; flex-direction: column; background: #fff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 20rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.info-item.data-v-569e925a { display: flex; justify-content: space-between; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.info-label.data-v-569e925a { color: #666; font-size: 24rpx
|
|
||||||
}
|
|
||||||
.info-value.data-v-569e925a { font-size: 28rpx
|
|
||||||
}
|
|
||||||
.stats.data-v-569e925a { display: flex; background: #fafafa; border-radius: 12rpx; padding: 20rpx; justify-content: space-between; margin-bottom: 20rpx
|
|
||||||
}
|
|
||||||
.stat.data-v-569e925a { flex: 1; align-items: center
|
|
||||||
}
|
|
||||||
.stat-label.data-v-569e925a { color: #666; font-size: 24rpx
|
|
||||||
}
|
|
||||||
.stat-value.data-v-569e925a { font-size: 36rpx; margin-top: 8rpx
|
|
||||||
}
|
|
||||||
.orders.data-v-569e925a { background: #fff; border-radius: 12rpx; padding: 20rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04); margin-bottom: 20rpx
|
|
||||||
}
|
|
||||||
.orders-title.data-v-569e925a { font-size: 30rpx; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.orders-cats.data-v-569e925a { display: flex; justify-content: space-between
|
|
||||||
}
|
|
||||||
.orders-cat.data-v-569e925a { flex: 1; background: #f7f7f7; border-radius: 12rpx; padding: 20rpx; margin-right: 12rpx
|
|
||||||
}
|
|
||||||
.orders-cat.data-v-569e925a:last-child { margin-right: 0
|
|
||||||
}
|
|
||||||
.orders-cat-title.data-v-569e925a { font-size: 28rpx; text-align: center
|
|
||||||
}
|
|
||||||
.addresses.data-v-569e925a { background: #fff; border-radius: 12rpx; padding: 20rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04); margin-bottom: 20rpx
|
|
||||||
}
|
|
||||||
.addresses-title.data-v-569e925a { font-size: 30rpx; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.addresses-entry.data-v-569e925a { display: flex; justify-content: space-between; align-items: center; background: #f7f7f7; border-radius: 12rpx; padding: 20rpx
|
|
||||||
}
|
|
||||||
.addresses-text.data-v-569e925a { font-size: 28rpx
|
|
||||||
}
|
|
||||||
.addresses-arrow.data-v-569e925a { font-size: 28rpx; color: #999
|
|
||||||
}
|
|
||||||
.refresh.data-v-569e925a { width: 100%; margin-top: 12rpx
|
|
||||||
}
|
|
||||||
.error.data-v-569e925a { color: #e43; margin-top: 20rpx
|
|
||||||
}
|
|
||||||
139
unpackage/dist/dev/mp-weixin/pages/orders/index.js
vendored
@ -1,139 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const currentTab = common_vendor.ref("pending");
|
|
||||||
const orders = common_vendor.ref([]);
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const loadingMore = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
const page = common_vendor.ref(1);
|
|
||||||
const pageSize = common_vendor.ref(20);
|
|
||||||
const hasMore = common_vendor.ref(true);
|
|
||||||
function formatTime(t) {
|
|
||||||
if (!t)
|
|
||||||
return "";
|
|
||||||
const d = typeof t === "string" ? new Date(t) : new Date(t);
|
|
||||||
const y = d.getFullYear();
|
|
||||||
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
||||||
const day = String(d.getDate()).padStart(2, "0");
|
|
||||||
const hh = String(d.getHours()).padStart(2, "0");
|
|
||||||
const mm = String(d.getMinutes()).padStart(2, "0");
|
|
||||||
return `${y}-${m}-${day} ${hh}:${mm}`;
|
|
||||||
}
|
|
||||||
function formatAmount(a) {
|
|
||||||
if (a === void 0 || a === null)
|
|
||||||
return "";
|
|
||||||
const n = Number(a);
|
|
||||||
if (Number.isNaN(n))
|
|
||||||
return String(a);
|
|
||||||
return `¥${n.toFixed(2)}`;
|
|
||||||
}
|
|
||||||
function statusText(s) {
|
|
||||||
const v = String(s || "").toLowerCase();
|
|
||||||
if (v.includes("pend"))
|
|
||||||
return "待付款";
|
|
||||||
if (v.includes("paid") || v.includes("complete") || v.includes("done"))
|
|
||||||
return "已完成";
|
|
||||||
return s || "";
|
|
||||||
}
|
|
||||||
function switchTab(tab) {
|
|
||||||
if (currentTab.value === tab)
|
|
||||||
return;
|
|
||||||
currentTab.value = tab;
|
|
||||||
fetchOrders(false);
|
|
||||||
}
|
|
||||||
function apiStatus() {
|
|
||||||
return currentTab.value === "pending" ? "pending" : "completed";
|
|
||||||
}
|
|
||||||
async function fetchOrders(append) {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!user_id || !token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (append) {
|
|
||||||
if (!hasMore.value || loadingMore.value)
|
|
||||||
return;
|
|
||||||
loadingMore.value = true;
|
|
||||||
page.value = page.value + 1;
|
|
||||||
} else {
|
|
||||||
loading.value = true;
|
|
||||||
page.value = 1;
|
|
||||||
hasMore.value = true;
|
|
||||||
orders.value = [];
|
|
||||||
}
|
|
||||||
error.value = "";
|
|
||||||
try {
|
|
||||||
const list = await api_appUser.getOrders(user_id, apiStatus(), page.value, pageSize.value);
|
|
||||||
const items = Array.isArray(list) ? list : list && list.items || [];
|
|
||||||
const total = list && list.total || 0;
|
|
||||||
orders.value = append ? orders.value.concat(items) : items;
|
|
||||||
if (total) {
|
|
||||||
hasMore.value = orders.value.length < total;
|
|
||||||
} else {
|
|
||||||
hasMore.value = items.length === pageSize.value;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
error.value = e && (e.message || e.errMsg) || "获取订单失败";
|
|
||||||
} finally {
|
|
||||||
if (append) {
|
|
||||||
loadingMore.value = false;
|
|
||||||
} else {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.onLoad((opts) => {
|
|
||||||
const s = opts && opts.status || "";
|
|
||||||
if (s === "completed" || s === "pending")
|
|
||||||
currentTab.value = s;
|
|
||||||
fetchOrders(false);
|
|
||||||
});
|
|
||||||
common_vendor.onReachBottom(() => {
|
|
||||||
fetchOrders(true);
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: currentTab.value === "pending" ? 1 : "",
|
|
||||||
b: common_vendor.o(($event) => switchTab("pending")),
|
|
||||||
c: currentTab.value === "completed" ? 1 : "",
|
|
||||||
d: common_vendor.o(($event) => switchTab("completed")),
|
|
||||||
e: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
f: common_vendor.t(error.value)
|
|
||||||
} : {}, {
|
|
||||||
g: orders.value.length === 0 && !loading.value
|
|
||||||
}, orders.value.length === 0 && !loading.value ? {} : {}, {
|
|
||||||
h: common_vendor.f(orders.value, (item, k0, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.title || item.subject || "订单"),
|
|
||||||
b: common_vendor.t(formatTime(item.created_at || item.time)),
|
|
||||||
c: common_vendor.t(formatAmount(item.total_amount || item.amount || item.price)),
|
|
||||||
d: common_vendor.t(statusText(item.status || item.pay_status || item.state)),
|
|
||||||
e: item.id || item.order_no
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
i: loadingMore.value
|
|
||||||
}, loadingMore.value ? {} : !hasMore.value && orders.value.length > 0 ? {} : {}, {
|
|
||||||
j: !hasMore.value && orders.value.length > 0
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-e1e6274e"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/orders/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "我的订单",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-e1e6274e"><view class="tabs data-v-e1e6274e"><view class="{{['tab', 'data-v-e1e6274e', a && 'active']}}" bindtap="{{b}}">待付款</view><view class="{{['tab', 'data-v-e1e6274e', c && 'active']}}" bindtap="{{d}}">已完成</view></view><view wx:if="{{e}}" class="error data-v-e1e6274e">{{f}}</view><view wx:if="{{g}}" class="empty data-v-e1e6274e">暂无订单</view><view wx:for="{{h}}" wx:for-item="item" wx:key="e" class="order data-v-e1e6274e"><view class="order-main data-v-e1e6274e"><view class="order-title data-v-e1e6274e">{{item.a}}</view><view class="order-sub data-v-e1e6274e">{{item.b}}</view></view><view class="order-right data-v-e1e6274e"><view class="order-amount data-v-e1e6274e">{{item.c}}</view><view class="order-status data-v-e1e6274e">{{item.d}}</view></view></view><view wx:if="{{i}}" class="loading data-v-e1e6274e">加载中...</view><view wx:elif="{{j}}" class="end data-v-e1e6274e">没有更多了</view></view>
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-e1e6274e { padding: 24rpx
|
|
||||||
}
|
|
||||||
.tabs.data-v-e1e6274e { display: flex; background: #fff; border-radius: 12rpx; padding: 8rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.tab.data-v-e1e6274e { flex: 1; text-align: center; padding: 16rpx 0; font-size: 28rpx; color: #666
|
|
||||||
}
|
|
||||||
.tab.active.data-v-e1e6274e { color: #007AFF; font-weight: 600
|
|
||||||
}
|
|
||||||
.order.data-v-e1e6274e { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.order-main.data-v-e1e6274e { display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.order-title.data-v-e1e6274e { font-size: 28rpx; color: #333
|
|
||||||
}
|
|
||||||
.order-sub.data-v-e1e6274e { font-size: 24rpx; color: #999; margin-top: 6rpx
|
|
||||||
}
|
|
||||||
.order-right.data-v-e1e6274e { display: flex; flex-direction: column; align-items: flex-end
|
|
||||||
}
|
|
||||||
.order-amount.data-v-e1e6274e { font-size: 28rpx; color: #333
|
|
||||||
}
|
|
||||||
.order-status.data-v-e1e6274e { font-size: 24rpx; color: #666; margin-top: 6rpx
|
|
||||||
}
|
|
||||||
.empty.data-v-e1e6274e { text-align: center; color: #999; margin-top: 40rpx
|
|
||||||
}
|
|
||||||
.error.data-v-e1e6274e { color: #e43; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.loading.data-v-e1e6274e { text-align: center; color: #666; margin: 20rpx 0
|
|
||||||
}
|
|
||||||
.end.data-v-e1e6274e { text-align: center; color: #999; margin: 20rpx 0
|
|
||||||
}
|
|
||||||
111
unpackage/dist/dev/mp-weixin/pages/points/index.js
vendored
@ -1,111 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const api_appUser = require("../../api/appUser.js");
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const records = common_vendor.ref([]);
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const loadingMore = common_vendor.ref(false);
|
|
||||||
const error = common_vendor.ref("");
|
|
||||||
const page = common_vendor.ref(1);
|
|
||||||
const pageSize = common_vendor.ref(20);
|
|
||||||
const hasMore = common_vendor.ref(true);
|
|
||||||
function formatTime(t) {
|
|
||||||
if (!t)
|
|
||||||
return "";
|
|
||||||
const d = typeof t === "string" ? new Date(t) : new Date(t);
|
|
||||||
const y = d.getFullYear();
|
|
||||||
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
||||||
const day = String(d.getDate()).padStart(2, "0");
|
|
||||||
const hh = String(d.getHours()).padStart(2, "0");
|
|
||||||
const mm = String(d.getMinutes()).padStart(2, "0");
|
|
||||||
return `${y}-${m}-${day} ${hh}:${mm}`;
|
|
||||||
}
|
|
||||||
async function fetchRecords(append = false) {
|
|
||||||
const user_id = common_vendor.index.getStorageSync("user_id");
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!user_id || !token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (append) {
|
|
||||||
if (!hasMore.value || loadingMore.value)
|
|
||||||
return;
|
|
||||||
loadingMore.value = true;
|
|
||||||
page.value = page.value + 1;
|
|
||||||
} else {
|
|
||||||
loading.value = true;
|
|
||||||
page.value = 1;
|
|
||||||
hasMore.value = true;
|
|
||||||
}
|
|
||||||
error.value = "";
|
|
||||||
try {
|
|
||||||
const list = await api_appUser.getPointsRecords(user_id, page.value, pageSize.value);
|
|
||||||
const items = Array.isArray(list) ? list : list && list.items || [];
|
|
||||||
const total = list && list.total || 0;
|
|
||||||
if (append) {
|
|
||||||
records.value = records.value.concat(items);
|
|
||||||
} else {
|
|
||||||
records.value = items;
|
|
||||||
}
|
|
||||||
if (total) {
|
|
||||||
hasMore.value = records.value.length < total;
|
|
||||||
} else {
|
|
||||||
hasMore.value = items.length === pageSize.value;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
error.value = e && (e.message || e.errMsg) || "获取积分记录失败";
|
|
||||||
} finally {
|
|
||||||
if (append) {
|
|
||||||
loadingMore.value = false;
|
|
||||||
} else {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
common_vendor.onLoad(() => {
|
|
||||||
fetchRecords(false);
|
|
||||||
});
|
|
||||||
common_vendor.onReachBottom(() => {
|
|
||||||
fetchRecords(true);
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: error.value
|
|
||||||
}, error.value ? {
|
|
||||||
b: common_vendor.t(error.value)
|
|
||||||
} : {}, {
|
|
||||||
c: records.value.length === 0 && !loading.value
|
|
||||||
}, records.value.length === 0 && !loading.value ? {} : {}, {
|
|
||||||
d: common_vendor.f(records.value, (item, k0, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.t(item.title || item.reason || "变更"),
|
|
||||||
b: common_vendor.t(formatTime(item.time || item.created_at)),
|
|
||||||
c: common_vendor.t((item.change ?? item.amount ?? 0) > 0 ? "+" : ""),
|
|
||||||
d: common_vendor.t(item.change ?? item.amount ?? 0),
|
|
||||||
e: (item.change || item.amount || 0) > 0 ? 1 : "",
|
|
||||||
f: (item.change || item.amount || 0) < 0 ? 1 : "",
|
|
||||||
g: item.id || item.time || item.created_at
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
e: loadingMore.value
|
|
||||||
}, loadingMore.value ? {} : !hasMore.value && records.value.length > 0 ? {} : {}, {
|
|
||||||
f: !hasMore.value && records.value.length > 0
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-dd6e20da"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/points/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "积分记录",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="wrap data-v-dd6e20da"><view wx:if="{{a}}" class="error data-v-dd6e20da">{{b}}</view><view wx:if="{{c}}" class="empty data-v-dd6e20da">暂无积分记录</view><view wx:for="{{d}}" wx:for-item="item" wx:key="g" class="record data-v-dd6e20da"><view class="record-main data-v-dd6e20da"><view class="record-title data-v-dd6e20da">{{item.a}}</view><view class="record-time data-v-dd6e20da">{{item.b}}</view></view><view class="{{['record-amount', 'data-v-dd6e20da', item.e && 'inc', item.f && 'dec']}}">{{item.c}}{{item.d}}</view></view><view wx:if="{{e}}" class="loading data-v-dd6e20da">加载中...</view><view wx:elif="{{f}}" class="end data-v-dd6e20da">没有更多了</view></view>
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
.wrap.data-v-dd6e20da { padding: 24rpx
|
|
||||||
}
|
|
||||||
.record.data-v-dd6e20da { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04)
|
|
||||||
}
|
|
||||||
.record-main.data-v-dd6e20da { display: flex; flex-direction: column
|
|
||||||
}
|
|
||||||
.record-title.data-v-dd6e20da { font-size: 28rpx; color: #333
|
|
||||||
}
|
|
||||||
.record-time.data-v-dd6e20da { font-size: 24rpx; color: #999; margin-top: 6rpx
|
|
||||||
}
|
|
||||||
.record-amount.data-v-dd6e20da { font-size: 32rpx
|
|
||||||
}
|
|
||||||
.record-amount.inc.data-v-dd6e20da { color: #18a058
|
|
||||||
}
|
|
||||||
.record-amount.dec.data-v-dd6e20da { color: #d03050
|
|
||||||
}
|
|
||||||
.empty.data-v-dd6e20da { text-align: center; color: #999; margin-top: 40rpx
|
|
||||||
}
|
|
||||||
.error.data-v-dd6e20da { color: #e43; margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.loading.data-v-dd6e20da { text-align: center; color: #666; margin: 20rpx 0
|
|
||||||
}
|
|
||||||
.end.data-v-dd6e20da { text-align: center; color: #999; margin: 20rpx 0
|
|
||||||
}
|
|
||||||
293
unpackage/dist/dev/mp-weixin/pages/shop/index.js
vendored
@ -1,293 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../../common/vendor.js");
|
|
||||||
const utils_request = require("../../utils/request.js");
|
|
||||||
const CACHE_KEY = "products_cache_v1";
|
|
||||||
const TTL_MS = 10 * 60 * 1e3;
|
|
||||||
const _sfc_main = {
|
|
||||||
__name: "index",
|
|
||||||
setup(__props) {
|
|
||||||
const products = common_vendor.ref([]);
|
|
||||||
const columns = common_vendor.ref([[], []]);
|
|
||||||
const colHeights = common_vendor.ref([0, 0]);
|
|
||||||
const loading = common_vendor.ref(false);
|
|
||||||
const keyword = common_vendor.ref("");
|
|
||||||
const minPrice = common_vendor.ref("");
|
|
||||||
const maxPrice = common_vendor.ref("");
|
|
||||||
const displayCount = common_vendor.computed(() => columns.value[0].length + columns.value[1].length);
|
|
||||||
const loadedMap = common_vendor.ref({});
|
|
||||||
function getKey(p) {
|
|
||||||
return String((p && p.id) ?? "") + "|" + String((p && p.image) ?? "");
|
|
||||||
}
|
|
||||||
function unwrap(list) {
|
|
||||||
if (Array.isArray(list))
|
|
||||||
return list;
|
|
||||||
const obj = list || {};
|
|
||||||
const data = obj.data || {};
|
|
||||||
const arr = obj.list || obj.items || data.list || data.items || data;
|
|
||||||
return Array.isArray(arr) ? arr : [];
|
|
||||||
}
|
|
||||||
function cleanUrl(u) {
|
|
||||||
const s = String(u || "").trim();
|
|
||||||
const m = s.match(/https?:\/\/[^\s'"`]+/);
|
|
||||||
if (m && m[0])
|
|
||||||
return m[0];
|
|
||||||
return s.replace(/[`'\"]/g, "").trim();
|
|
||||||
}
|
|
||||||
function apiGet(url, data = {}) {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const fn = token ? utils_request.authRequest : utils_request.request;
|
|
||||||
return fn({ url, method: "GET", data });
|
|
||||||
}
|
|
||||||
function getCachedProducts() {
|
|
||||||
try {
|
|
||||||
const obj = common_vendor.index.getStorageSync(CACHE_KEY);
|
|
||||||
if (obj && Array.isArray(obj.data) && typeof obj.ts === "number") {
|
|
||||||
const fresh = Date.now() - obj.ts < TTL_MS;
|
|
||||||
if (fresh)
|
|
||||||
return obj.data;
|
|
||||||
}
|
|
||||||
} catch (_) {
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
function setCachedProducts(list) {
|
|
||||||
try {
|
|
||||||
common_vendor.index.setStorageSync(CACHE_KEY, { data: Array.isArray(list) ? list : [], ts: Date.now() });
|
|
||||||
} catch (_) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function estimateHeight(p) {
|
|
||||||
const base = 220;
|
|
||||||
const len = String(p.title || "").length;
|
|
||||||
const lines = Math.min(2, Math.ceil(len / 12));
|
|
||||||
const titleH = lines * 36;
|
|
||||||
const stockH = p.stock !== null && p.stock !== void 0 ? 34 : 0;
|
|
||||||
const padding = 28;
|
|
||||||
return base + titleH + stockH + padding;
|
|
||||||
}
|
|
||||||
function distributeToColumns(list) {
|
|
||||||
const arr = Array.isArray(list) ? list : [];
|
|
||||||
const cols = Array.from({ length: 2 }, () => []);
|
|
||||||
const hs = [0, 0];
|
|
||||||
for (let i = 0; i < arr.length; i++) {
|
|
||||||
const h = estimateHeight(arr[i]);
|
|
||||||
const idx = hs[0] <= hs[1] ? 0 : 1;
|
|
||||||
cols[idx].push(arr[i]);
|
|
||||||
hs[idx] += h;
|
|
||||||
}
|
|
||||||
columns.value = cols;
|
|
||||||
colHeights.value = hs;
|
|
||||||
const presentKeys = new Set(arr.map(getKey));
|
|
||||||
const next = {};
|
|
||||||
const prev = loadedMap.value || {};
|
|
||||||
for (const k in prev) {
|
|
||||||
if (presentKeys.has(k))
|
|
||||||
next[k] = prev[k];
|
|
||||||
}
|
|
||||||
loadedMap.value = next;
|
|
||||||
}
|
|
||||||
function extractListAndTotal(payload) {
|
|
||||||
if (Array.isArray(payload))
|
|
||||||
return { list: payload, total: payload.length };
|
|
||||||
const obj = payload || {};
|
|
||||||
const data = obj.data || {};
|
|
||||||
const list = obj.list || obj.items || data.list || data.items || [];
|
|
||||||
const totalRaw = obj.total ?? data.total;
|
|
||||||
const total = typeof totalRaw === "number" ? totalRaw : Array.isArray(list) ? list.length : 0;
|
|
||||||
return { list: Array.isArray(list) ? list : [], total };
|
|
||||||
}
|
|
||||||
function normalizeProducts(list) {
|
|
||||||
const arr = unwrap(list);
|
|
||||||
return arr.map((i, idx) => ({
|
|
||||||
id: i.id ?? i.productId ?? i._id ?? i.sku_id ?? String(idx),
|
|
||||||
image: cleanUrl(i.main_image ?? i.imageUrl ?? i.image_url ?? i.image ?? i.img ?? i.pic ?? ""),
|
|
||||||
title: i.title ?? i.name ?? i.product_name ?? i.sku_name ?? "",
|
|
||||||
price: i.price_sale ?? i.price ?? i.price_min ?? i.amount ?? null,
|
|
||||||
points: i.points_required ?? i.points ?? i.integral ?? null,
|
|
||||||
stock: i.stock ?? i.inventory ?? i.quantity ?? null,
|
|
||||||
link: cleanUrl(i.linkUrl ?? i.link_url ?? i.link ?? i.url ?? "")
|
|
||||||
})).filter((i) => i.image || i.title);
|
|
||||||
}
|
|
||||||
function onProductTap(p) {
|
|
||||||
const imgs = (Array.isArray(products.value) ? products.value : []).map((x) => x.image).filter(Boolean);
|
|
||||||
const current = p && p.image;
|
|
||||||
if (current) {
|
|
||||||
common_vendor.index.previewImage({ urls: imgs.length ? imgs : [current], current });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (p.link && /^\/.+/.test(p.link)) {
|
|
||||||
common_vendor.index.navigateTo({ url: p.link });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function applyFilters() {
|
|
||||||
const k = String(keyword.value || "").trim().toLowerCase();
|
|
||||||
const min = Number(minPrice.value);
|
|
||||||
const max = Number(maxPrice.value);
|
|
||||||
const hasMin = !isNaN(min) && String(minPrice.value).trim() !== "";
|
|
||||||
const hasMax = !isNaN(max) && String(maxPrice.value).trim() !== "";
|
|
||||||
const list = Array.isArray(products.value) ? products.value : [];
|
|
||||||
const filtered = list.filter((p) => {
|
|
||||||
const title = String(p.title || "").toLowerCase();
|
|
||||||
if (k && !title.includes(k))
|
|
||||||
return false;
|
|
||||||
const priceNum = typeof p.price === "number" ? p.price : Number(p.price);
|
|
||||||
if (hasMin) {
|
|
||||||
if (isNaN(priceNum))
|
|
||||||
return false;
|
|
||||||
if (priceNum < min)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (hasMax) {
|
|
||||||
if (isNaN(priceNum))
|
|
||||||
return false;
|
|
||||||
if (priceNum > max)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
distributeToColumns(filtered);
|
|
||||||
}
|
|
||||||
function onSearchConfirm() {
|
|
||||||
applyFilters();
|
|
||||||
}
|
|
||||||
function onApplyFilters() {
|
|
||||||
applyFilters();
|
|
||||||
}
|
|
||||||
async function loadProducts() {
|
|
||||||
try {
|
|
||||||
const cached = getCachedProducts();
|
|
||||||
if (cached) {
|
|
||||||
products.value = cached;
|
|
||||||
distributeToColumns(cached);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const first = await apiGet("/api/app/products", { page: 1 });
|
|
||||||
const { list: firstList, total } = extractListAndTotal(first);
|
|
||||||
const pageSize = 20;
|
|
||||||
const totalPages = Math.max(1, Math.ceil((typeof total === "number" ? total : 0) / pageSize));
|
|
||||||
if (totalPages <= 1) {
|
|
||||||
const normalized2 = normalizeProducts(firstList);
|
|
||||||
products.value = normalized2;
|
|
||||||
distributeToColumns(normalized2);
|
|
||||||
setCachedProducts(normalized2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const tasks = [];
|
|
||||||
for (let p = 2; p <= totalPages; p++) {
|
|
||||||
tasks.push(apiGet("/api/app/products", { page: p }));
|
|
||||||
}
|
|
||||||
const results = await Promise.allSettled(tasks);
|
|
||||||
const restLists = results.map((r) => {
|
|
||||||
if (r.status === "fulfilled") {
|
|
||||||
const { list } = extractListAndTotal(r.value);
|
|
||||||
return Array.isArray(list) ? list : [];
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
});
|
|
||||||
const merged = [firstList, ...restLists].flat();
|
|
||||||
const normalized = normalizeProducts(merged);
|
|
||||||
products.value = normalized;
|
|
||||||
distributeToColumns(normalized);
|
|
||||||
setCachedProducts(normalized);
|
|
||||||
} catch (e) {
|
|
||||||
products.value = [];
|
|
||||||
columns.value = [[], []];
|
|
||||||
colHeights.value = [0, 0];
|
|
||||||
const presentKeys = /* @__PURE__ */ new Set([]);
|
|
||||||
const next = {};
|
|
||||||
const prev = loadedMap.value || {};
|
|
||||||
for (const k in prev) {
|
|
||||||
if (presentKeys.has(k))
|
|
||||||
next[k] = prev[k];
|
|
||||||
}
|
|
||||||
loadedMap.value = next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function isLoaded(p) {
|
|
||||||
return !!(loadedMap.value && loadedMap.value[getKey(p)]);
|
|
||||||
}
|
|
||||||
function onImageLoad(p) {
|
|
||||||
const k = getKey(p);
|
|
||||||
if (!k)
|
|
||||||
return;
|
|
||||||
loadedMap.value = { ...loadedMap.value || {}, [k]: true };
|
|
||||||
}
|
|
||||||
function onImageError(p) {
|
|
||||||
const k = getKey(p);
|
|
||||||
if (!k)
|
|
||||||
return;
|
|
||||||
const prev = { ...loadedMap.value || {} };
|
|
||||||
delete prev[k];
|
|
||||||
loadedMap.value = prev;
|
|
||||||
}
|
|
||||||
common_vendor.onShow(async () => {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const phoneBound = !!common_vendor.index.getStorageSync("phone_bound");
|
|
||||||
if (!token || !phoneBound) {
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "请先登录并绑定手机号",
|
|
||||||
confirmText: "去登录",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
loading.value = true;
|
|
||||||
await loadProducts();
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
return (_ctx, _cache) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: loading.value
|
|
||||||
}, loading.value ? {} : common_vendor.e({
|
|
||||||
b: common_vendor.o(onSearchConfirm),
|
|
||||||
c: keyword.value,
|
|
||||||
d: common_vendor.o(($event) => keyword.value = $event.detail.value),
|
|
||||||
e: minPrice.value,
|
|
||||||
f: common_vendor.o(($event) => minPrice.value = $event.detail.value),
|
|
||||||
g: maxPrice.value,
|
|
||||||
h: common_vendor.o(($event) => maxPrice.value = $event.detail.value),
|
|
||||||
i: common_vendor.o(onApplyFilters),
|
|
||||||
j: displayCount.value
|
|
||||||
}, displayCount.value ? {
|
|
||||||
k: common_vendor.f(columns.value, (col, ci, i0) => {
|
|
||||||
return {
|
|
||||||
a: common_vendor.f(col, (p, k1, i1) => {
|
|
||||||
return common_vendor.e({
|
|
||||||
a: isLoaded(p) ? 1 : "",
|
|
||||||
b: p.image,
|
|
||||||
c: common_vendor.o(($event) => onImageLoad(p), p.id),
|
|
||||||
d: common_vendor.o(($event) => onImageError(p), p.id),
|
|
||||||
e: !isLoaded(p)
|
|
||||||
}, !isLoaded(p) ? {} : {}, {
|
|
||||||
f: p.price !== null
|
|
||||||
}, p.price !== null ? {
|
|
||||||
g: common_vendor.t(p.price)
|
|
||||||
} : {}, {
|
|
||||||
h: p.points !== null
|
|
||||||
}, p.points !== null ? {
|
|
||||||
i: common_vendor.t(p.points)
|
|
||||||
} : {}, {
|
|
||||||
j: common_vendor.t(p.title),
|
|
||||||
k: p.stock !== null
|
|
||||||
}, p.stock !== null ? {
|
|
||||||
l: common_vendor.t(p.stock)
|
|
||||||
} : {}, {
|
|
||||||
m: p.id,
|
|
||||||
n: common_vendor.o(($event) => onProductTap(p), p.id)
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
b: ci
|
|
||||||
};
|
|
||||||
})
|
|
||||||
} : {}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7db6cc15"]]);
|
|
||||||
wx.createPage(MiniProgramPage);
|
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/shop/index.js.map
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"navigationBarTitleText": "商城",
|
|
||||||
"usingComponents": {}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<view class="page data-v-7db6cc15"><view wx:if="{{a}}" class="loading-wrap data-v-7db6cc15"><view class="spinner data-v-7db6cc15"></view></view><view wx:else class="products-section data-v-7db6cc15"><view class="section-title data-v-7db6cc15">商品</view><view class="toolbar data-v-7db6cc15"><input class="search data-v-7db6cc15" placeholder="搜索商品" confirm-type="search" bindconfirm="{{b}}" value="{{c}}" bindinput="{{d}}"/><view class="filters data-v-7db6cc15"><input class="price data-v-7db6cc15" type="number" placeholder="最低价" value="{{e}}" bindinput="{{f}}"/><text class="dash data-v-7db6cc15">-</text><input class="price data-v-7db6cc15" type="number" placeholder="最高价" value="{{g}}" bindinput="{{h}}"/><button class="apply-btn data-v-7db6cc15" size="mini" bindtap="{{i}}">筛选</button></view></view><view wx:if="{{j}}" class="products-columns data-v-7db6cc15"><view wx:for="{{k}}" wx:for-item="col" wx:key="b" class="column data-v-7db6cc15"><view wx:for="{{col.a}}" wx:for-item="p" wx:key="m" class="product-item data-v-7db6cc15" bindtap="{{p.n}}"><view class="product-card data-v-7db6cc15"><view class="thumb-wrap data-v-7db6cc15"><image class="{{['product-thumb', 'data-v-7db6cc15', p.a && 'visible']}}" src="{{p.b}}" mode="widthFix" lazy-load="true" bindload="{{p.c}}" binderror="{{p.d}}"/><view wx:if="{{p.e}}" class="skeleton data-v-7db6cc15"></view><view class="badge data-v-7db6cc15"><text wx:if="{{p.f}}" class="badge-price data-v-7db6cc15">¥{{p.g}}</text><text wx:if="{{p.h}}" class="badge-points data-v-7db6cc15">{{p.i}}积分</text></view></view><text class="product-title data-v-7db6cc15">{{p.j}}</text><view wx:if="{{p.k}}" class="product-extra data-v-7db6cc15"><text class="stock data-v-7db6cc15">库存 {{p.l}}</text></view></view></view></view></view><view wx:else class="empty data-v-7db6cc15">暂无商品</view></view></view>
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
|
|
||||||
.page.data-v-7db6cc15 { padding: 24rpx
|
|
||||||
}
|
|
||||||
.section-title.data-v-7db6cc15 { font-size: 30rpx; font-weight: 600; margin-bottom: 16rpx
|
|
||||||
}
|
|
||||||
.products-section.data-v-7db6cc15 { background: #ffffff; border-radius: 12rpx; padding: 24rpx; margin-top: 24rpx
|
|
||||||
}
|
|
||||||
.loading-wrap.data-v-7db6cc15 { min-height: 60vh; display: flex; align-items: center; justify-content: center
|
|
||||||
}
|
|
||||||
.spinner.data-v-7db6cc15 { width: 56rpx; height: 56rpx; border: 6rpx solid rgba(0,122,255,0.15); border-top-color: #007AFF; border-radius: 50%; animation: spin-7db6cc15 1s linear infinite
|
|
||||||
}
|
|
||||||
@keyframes spin-7db6cc15 {
|
|
||||||
from { transform: rotate(0)
|
|
||||||
}
|
|
||||||
to { transform: rotate(360deg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.toolbar.data-v-7db6cc15 { display: flex; flex-direction: column; gap: 12rpx; margin-bottom: 16rpx
|
|
||||||
}
|
|
||||||
.search.data-v-7db6cc15 { background: #f6f8ff; border: 1rpx solid rgba(0,122,255,0.25); border-radius: 999rpx; padding: 14rpx 20rpx; font-size: 26rpx
|
|
||||||
}
|
|
||||||
.filters.data-v-7db6cc15 { display: flex; align-items: center; gap: 12rpx
|
|
||||||
}
|
|
||||||
.price.data-v-7db6cc15 { flex: 1; background: #f6f8ff; border: 1rpx solid rgba(0,122,255,0.25); border-radius: 999rpx; padding: 12rpx 16rpx; font-size: 26rpx
|
|
||||||
}
|
|
||||||
.dash.data-v-7db6cc15 { color: #888; font-size: 26rpx
|
|
||||||
}
|
|
||||||
.apply-btn.data-v-7db6cc15 { background: #007AFF; color: #fff; border-radius: 999rpx; padding: 0 20rpx
|
|
||||||
}
|
|
||||||
.products-columns.data-v-7db6cc15 { display: flex; gap: 12rpx
|
|
||||||
}
|
|
||||||
.column.data-v-7db6cc15 { flex: 1
|
|
||||||
}
|
|
||||||
.product-item.data-v-7db6cc15 { margin-bottom: 12rpx
|
|
||||||
}
|
|
||||||
.empty.data-v-7db6cc15 { padding: 40rpx; color: #888; text-align: center
|
|
||||||
}
|
|
||||||
.product-card.data-v-7db6cc15 { background: #fff; border-radius: 16rpx; overflow: hidden; box-shadow: 0 6rpx 16rpx rgba(0,122,255,0.08); transition: transform .15s ease
|
|
||||||
}
|
|
||||||
.product-item:active .product-card.data-v-7db6cc15 { transform: scale(0.98)
|
|
||||||
}
|
|
||||||
.thumb-wrap.data-v-7db6cc15 { position: relative
|
|
||||||
}
|
|
||||||
.product-thumb.data-v-7db6cc15 { width: 100%; height: auto; display: block; opacity: 0; transition: opacity .25s ease; z-index: 0
|
|
||||||
}
|
|
||||||
.product-thumb.visible.data-v-7db6cc15 { opacity: 1
|
|
||||||
}
|
|
||||||
.skeleton.data-v-7db6cc15 { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: linear-gradient(90deg, #eef2ff 25%, #f6f8ff 37%, #eef2ff 63%); background-size: 400% 100%; animation: shimmer-7db6cc15 1.2s ease infinite; z-index: 1
|
|
||||||
}
|
|
||||||
@keyframes shimmer-7db6cc15 {
|
|
||||||
0% { background-position: 100% 0
|
|
||||||
}
|
|
||||||
100% { background-position: 0 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.thumb-wrap.data-v-7db6cc15 { background: #f6f8ff; min-height: 220rpx
|
|
||||||
}
|
|
||||||
.badge.data-v-7db6cc15 { position: absolute; left: 12rpx; bottom: 12rpx; display: flex; gap: 8rpx
|
|
||||||
}
|
|
||||||
.badge-price.data-v-7db6cc15 { background: #007AFF; color: #fff; font-size: 22rpx; padding: 6rpx 12rpx; border-radius: 999rpx; box-shadow: 0 2rpx 8rpx rgba(0,122,255,0.25)
|
|
||||||
}
|
|
||||||
.badge-points.data-v-7db6cc15 { background: rgba(0,122,255,0.85); color: #fff; font-size: 22rpx; padding: 6rpx 12rpx; border-radius: 999rpx
|
|
||||||
}
|
|
||||||
.product-title.data-v-7db6cc15 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 12rpx; font-size: 26rpx; color: #222
|
|
||||||
}
|
|
||||||
.product-extra.data-v-7db6cc15 { display: flex; justify-content: flex-end; align-items: center; margin: 0 12rpx 12rpx
|
|
||||||
}
|
|
||||||
.stock.data-v-7db6cc15 { font-size: 22rpx; color: #888
|
|
||||||
}
|
|
||||||
36
unpackage/dist/dev/mp-weixin/project.config.json
vendored
@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "项目配置文件。",
|
|
||||||
"packOptions": {
|
|
||||||
"ignore": []
|
|
||||||
},
|
|
||||||
"setting": {
|
|
||||||
"urlCheck": false,
|
|
||||||
"es6": true,
|
|
||||||
"postcss": true,
|
|
||||||
"minified": true,
|
|
||||||
"newFeature": true,
|
|
||||||
"bigPackageSizeSupport": true
|
|
||||||
},
|
|
||||||
"compileType": "miniprogram",
|
|
||||||
"libVersion": "",
|
|
||||||
"appid": "wx26ad074017e1e63f",
|
|
||||||
"projectname": "app_client",
|
|
||||||
"condition": {
|
|
||||||
"search": {
|
|
||||||
"current": -1,
|
|
||||||
"list": []
|
|
||||||
},
|
|
||||||
"conversation": {
|
|
||||||
"current": -1,
|
|
||||||
"list": []
|
|
||||||
},
|
|
||||||
"game": {
|
|
||||||
"current": -1,
|
|
||||||
"list": []
|
|
||||||
},
|
|
||||||
"miniprogram": {
|
|
||||||
"current": -1,
|
|
||||||
"list": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BIN
unpackage/dist/dev/mp-weixin/static/logo.png
vendored
|
Before Width: | Height: | Size: 3.9 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tab/box.png
vendored
|
Before Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 651 B |
BIN
unpackage/dist/dev/mp-weixin/static/tab/home.png
vendored
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tab/profile.png
vendored
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
BIN
unpackage/dist/dev/mp-weixin/static/tab/shop.png
vendored
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
117
unpackage/dist/dev/mp-weixin/utils/request.js
vendored
@ -1,117 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
const common_vendor = require("../common/vendor.js");
|
|
||||||
const BASE_URL = "https://mini-chat.1024tool.vip";
|
|
||||||
let authModalShown = false;
|
|
||||||
function handleAuthExpired() {
|
|
||||||
if (authModalShown)
|
|
||||||
return;
|
|
||||||
authModalShown = true;
|
|
||||||
common_vendor.index.removeStorageSync("token");
|
|
||||||
common_vendor.index.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "账号登录已过期,请重新登录",
|
|
||||||
showCancel: false,
|
|
||||||
success: () => {
|
|
||||||
authModalShown = false;
|
|
||||||
common_vendor.index.navigateTo({ url: "/pages/login/index" });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function request({ url, method = "GET", data = {}, header = {} }) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const finalHeader = { ...buildDefaultHeaders(), ...header };
|
|
||||||
try {
|
|
||||||
common_vendor.index.__f__("log", "at utils/request.js:25", "HTTP request", method, url, "data", data, "headers", finalHeader);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
common_vendor.index.request({
|
|
||||||
url: BASE_URL + url,
|
|
||||||
method,
|
|
||||||
data,
|
|
||||||
header: finalHeader,
|
|
||||||
timeout: 15e3,
|
|
||||||
success: (res) => {
|
|
||||||
const code = res.statusCode;
|
|
||||||
try {
|
|
||||||
common_vendor.index.__f__("log", "at utils/request.js:34", "HTTP response", method, url, "status", code, "body", res.data);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
if (code >= 200 && code < 300) {
|
|
||||||
const body = res.data;
|
|
||||||
resolve(body && body.data !== void 0 ? body.data : body);
|
|
||||||
} else {
|
|
||||||
if (code === 401) {
|
|
||||||
const suppress = finalHeader && (finalHeader["X-Suppress-Auth-Modal"] || finalHeader["x-suppress-auth-modal"]);
|
|
||||||
if (!suppress) {
|
|
||||||
handleAuthExpired();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const msg = res.data && (res.data.message || res.data.msg) || "请求错误";
|
|
||||||
reject({ message: msg, statusCode: code, data: res.data });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
try {
|
|
||||||
common_vendor.index.__f__("error", "at utils/request.js:50", "HTTP fail", method, url, "err", err);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function authRequest(options) {
|
|
||||||
const token = common_vendor.index.getStorageSync("token");
|
|
||||||
const base = buildDefaultHeaders();
|
|
||||||
const header = { ...base, ...options.header || {} };
|
|
||||||
if (token) {
|
|
||||||
header.Authorization = token;
|
|
||||||
header.authorization = token;
|
|
||||||
}
|
|
||||||
return request({ ...options, header });
|
|
||||||
}
|
|
||||||
function getDeviceId() {
|
|
||||||
try {
|
|
||||||
let id = common_vendor.index.getStorageSync("device_id");
|
|
||||||
if (!id) {
|
|
||||||
id = "dev-" + Date.now().toString(36) + "-" + Math.random().toString(36).slice(2, 8);
|
|
||||||
common_vendor.index.setStorageSync("device_id", id);
|
|
||||||
}
|
|
||||||
return id;
|
|
||||||
} catch (_) {
|
|
||||||
return "dev-unknown";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function buildDefaultHeaders() {
|
|
||||||
const info = common_vendor.index.getSystemInfoSync();
|
|
||||||
const lang = info.language || "zh-CN";
|
|
||||||
const platform = info.platform || "unknown";
|
|
||||||
const brand = info.brand || "";
|
|
||||||
const model = info.model || "";
|
|
||||||
const osName = info.system || "";
|
|
||||||
const osVersion = info.system ? info.system.split(" ")[1] || "" : "";
|
|
||||||
const screen = `${info.screenWidth}x${info.screenHeight}`;
|
|
||||||
const pixelRatio = info.pixelRatio || 1;
|
|
||||||
const windowSize = `${info.windowWidth}x${info.windowHeight}`;
|
|
||||||
return {
|
|
||||||
"Accept": "application/json",
|
|
||||||
"content-type": "application/json",
|
|
||||||
"X-Requested-With": "XMLHttpRequest",
|
|
||||||
"Accept-Language": lang,
|
|
||||||
"X-App-Client": "uni-app",
|
|
||||||
"X-App-Platform": platform,
|
|
||||||
"X-Device-Id": getDeviceId(),
|
|
||||||
"X-Device-Brand": brand,
|
|
||||||
"X-Device-Model": model,
|
|
||||||
"X-OS-Name": osName,
|
|
||||||
"X-OS-Version": osVersion,
|
|
||||||
"X-Screen": screen,
|
|
||||||
"X-Pixel-Ratio": pixelRatio,
|
|
||||||
"X-Window": windowSize,
|
|
||||||
"Cache-Control": "no-cache",
|
|
||||||
"User-Agent": `UniApp/${platform} (${brand} ${model}; ${osName} ${osVersion}) MiniProgram`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
exports.authRequest = authRequest;
|
|
||||||
exports.request = request;
|
|
||||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/request.js.map
|
|
||||||