Compare commits

..

5 Commits

Author SHA1 Message Date
zpc
504452087e Merge branch 'youda' into youda_wz 2025-04-18 11:49:38 +08:00
zpc
e077da1515 提交 2025-04-18 11:23:12 +08:00
zpc
55a6b589ab Merge branch 'youda' into youda_wz 2025-04-18 11:17:22 +08:00
zpc
1150eb5a9d Merge branch 'main' into youda_wz 2025-04-16 20:54:47 +08:00
zpc
4834ebfdf7 提交 2025-04-16 20:38:40 +08:00
5 changed files with 37 additions and 72 deletions

View File

@ -8,30 +8,28 @@ import RequestManager from '@/common/request.js'
let configData = null; let configData = null;
let isLoading = false; let isLoading = false;
let loadPromise = null; let loadPromise = null;
const wx_version = "100";
const defaultConfig = { const defaultConfig = {
"good_type": [{ "value": 0, "sort_order": 0, "is_show": 1, "name": "全部", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 1, "sort_order": 1, "is_show": 0, "name": "一番赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 2, "sort_order": 2, "is_show": 1, "name": "无限赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 3, "sort_order": 3, "is_show": 0, "name": "擂台赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 5, "sort_order": 4, "is_show": 0, "name": "积分赏", "pay_wechat": 0, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 0 }, { "value": 6, "sort_order": 5, "is_show": 1, "name": "限时活动", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 8, "sort_order": 6, "is_show": 1, "name": "领主赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 9, "sort_order": 7, "is_show": 0, "name": "连击赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 10, "sort_order": 8, "is_show": 0, "name": "商城赏", "pay_wechat": 1, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 0, "is_deduction": 0 }, { "value": 11, "sort_order": 9, "is_show": 0, "name": "自制赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 15, "sort_order": 15, "is_show": 0, "name": "福利屋", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }, { "value": 16, "sort_order": 16, "is_show": 1, "name": "翻倍赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 17, "sort_order": 17, "is_show": 0, "name": "外卖盒子", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }], "good_type": [{"value":0,"sort_order":0,"is_show":1,"name":"全部","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":1,"sort_order":1,"is_show":0,"name":"一番赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":2,"sort_order":2,"is_show":1,"name":"无限赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":3,"sort_order":3,"is_show":0,"name":"擂台赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":5,"sort_order":4,"is_show":0,"name":"积分赏","pay_wechat":0,"pay_balance":0,"pay_currency":0,"pay_currency2":1,"pay_coupon":1,"is_deduction":0},{"value":6,"sort_order":5,"is_show":1,"name":"限时活动","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":8,"sort_order":6,"is_show":1,"name":"领主赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":9,"sort_order":7,"is_show":0,"name":"连击赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":10,"sort_order":8,"is_show":0,"name":"商城赏","pay_wechat":1,"pay_balance":0,"pay_currency":0,"pay_currency2":1,"pay_coupon":0,"is_deduction":0},{"value":11,"sort_order":9,"is_show":0,"name":"自制赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":15,"sort_order":15,"is_show":0,"name":"福利屋","pay_wechat":1,"pay_balance":1,"pay_currency":0,"pay_currency2":0,"pay_coupon":0,"is_deduction":0},{"value":16,"sort_order":16,"is_show":1,"name":"翻倍赏","pay_wechat":1,"pay_balance":1,"pay_currency":1,"pay_currency2":1,"pay_coupon":1,"is_deduction":1},{"value":17,"sort_order":17,"is_show":0,"name":"外卖盒子","pay_wechat":1,"pay_balance":1,"pay_currency":0,"pay_currency2":0,"pay_coupon":0,"is_deduction":0}],
"app_setting": { "app_setting": {
"key": "app_setting", "key": "app_setting",
"app_name": "友达赏", "app_name": "友达赏",
"purchase_popup": "1", "purchase_popup": "1",
"exchange_times": "2", "exchange_times": "2",
"balance_name": "钻石", "balance_name": "钻石",
"balance_icon": "https://image.zfunbox.cn/app/icons/20250412/a482b527477e74f8a18ec02ebc7f0b4e.png", "balance_icon": "https://image.zfunbox.cn/app/icons/20250412/a482b527477e74f8a18ec02ebc7f0b4e.png",
"currency1_name": "UU币", "currency1_name": "UU币",
"currency1_icon": "https://image.zfunbox.cn/app/icons/20250412/3d1741965e9439372d1ce101bd110616.png", "currency1_icon": "https://image.zfunbox.cn/app/icons/20250412/3d1741965e9439372d1ce101bd110616.png",
"currency2_name": "达达券", "currency2_name": "达达券",
"currency2_icon": "https://image.zfunbox.cn/app/icons/20250412/19a9f69011fd82c85ab0df3a064a309c.png", "currency2_icon": "https://image.zfunbox.cn/app/icons/20250412/19a9f69011fd82c85ab0df3a064a309c.png",
"win_audio": "https://image.zfunbox.cn/app/20250407/14ba53d367e1d131a344c6fd5cc0e28e.mp3", "win_audio": "https://image.zfunbox.cn/app/20250407/14ba53d367e1d131a344c6fd5cc0e28e.mp3",
"applet_version": "v1.0.3", "applet_version": "v1.0.3",
"sign_in_spend_limit": "1", "sign_in_spend_limit": "1",
"waimai_box_id": "1049", "waimai_box_id": "1049",
"daily_free_draw_id": "1050", "daily_free_draw_id": "1050",
"cabinet_exchange_limit": "0", "cabinet_exchange_limit": "0",
"daily_coupon_limit": "0", "daily_coupon_limit": "0",
"update_time": 1744550962 "update_time": 1744550962
}, }
version: "100"
}; };
// 配置类 // 配置类
@ -74,12 +72,12 @@ class ConfigManager {
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
console.log('开始重启'); console.log('开始重启');
wx.restartMiniProgram({ path: "/pages/shouye/index" }); wx.restartMiniProgram({path:"/pages/shouye/index"});
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
//updateManager.applyUpdate(); //updateManager.applyUpdate();
//#ifdef MP-WEIXIN //#ifdef MP-WEIXIN
//#endif //#endif
} }
}, },
@ -135,7 +133,7 @@ class ConfigManager {
} else { } else {
configData = defaultConfig; configData = defaultConfig;
} }
} }
return key in configData ? configData[key] : defaultConfig[key]; return key in configData ? configData[key] : defaultConfig[key];
} }
@ -231,18 +229,6 @@ class ConfigManager {
} }
return key in appSetting ? appSetting[key] : null; return key in appSetting ? appSetting[key] : null;
} }
/**
* 获取版本号
* @returns {Boolean} 是否为微信版本
*/
static GetVersion() {
let version = this.get('version');
if (version == wx_version) {
return true;
}
return false;
}
} }
export default ConfigManager; export default ConfigManager;

View File

@ -17,10 +17,10 @@ const development = {
// 生产环境配置 // 生产环境配置
const production = { const production = {
// baseUrl: 'https://youda.zfunbox.cn',
baseUrl: 'https://api.zfunbox.cn', baseUrl: 'https://youda.zfunbox.cn',
imageUrl: 'https://image.zfunbox.cn', imageUrl: 'https://image.zfunbox.cn',
loginPage: 'https://api.zfunbox.cn/login.html', loginPage: 'https://youda.zfunbox.cn/login.html',
wxAppId: 'wx0e33d80d35e4a3b1' wxAppId: 'wx0e33d80d35e4a3b1'
}; };
@ -33,7 +33,7 @@ const testing = {
}; };
// 根据环境变量选择对应配置 // 根据环境变量选择对应配置
let currentEnv = testing; let currentEnv = development;
// 判断当前环境 // 判断当前环境
// #ifdef H5 // #ifdef H5
@ -46,7 +46,7 @@ if (process.env.NODE_ENV === 'production') {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// currentEnv =testing;//小程序默认使用测试环境配置 // currentEnv =testing;//小程序默认使用测试环境配置
// currentEnv = production; // 小程序默认使用生产环境配置 currentEnv = production; // 小程序默认使用生产环境配置
// #endif // #endif
// 衍生配置 // 衍生配置

View File

@ -5,7 +5,6 @@
import EnvConfig from '@/common/env.js' import EnvConfig from '@/common/env.js'
import md5 from 'js-md5' import md5 from 'js-md5'
import ConfigManager from '@/common/config.js'
class RequestManager { class RequestManager {
/** /**
@ -22,16 +21,6 @@ class RequestManager {
'api/warehouse_send_record' 'api/warehouse_send_record'
] ]
// 白名单URL列表
const whitelistUrls2 = [
'login_record',
]
let iswx = ConfigManager.GetVersion();
if (!iswx) {
return whitelistUrls2.some(whiteItem => url.indexOf(whiteItem) > -1)
}
// 检查URL是否包含白名单中的任一项 // 检查URL是否包含白名单中的任一项
return whitelistUrls.some(whiteItem => url.indexOf(whiteItem) > -1) return whitelistUrls.some(whiteItem => url.indexOf(whiteItem) > -1)
} }
@ -58,7 +47,7 @@ class RequestManager {
* @returns {Promise} 返回请求Promise * @returns {Promise} 返回请求Promise
*/ */
static request(param, backpage, backtype) { static request(param, backpage, backtype) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 参数检查 // 参数检查
if (!param || typeof param !== 'object') { if (!param || typeof param !== 'object') {
@ -113,7 +102,7 @@ class RequestManager {
const hostRegex = /^(?:https?:\/\/)?([^\/]+)/i const hostRegex = /^(?:https?:\/\/)?([^\/]+)/i
const matches = requestUrl.match(hostRegex) const matches = requestUrl.match(hostRegex)
const host = matches && matches[1] ? matches[1] : 'localhost' const host = matches && matches[1] ? matches[1] : 'localhost'
let header = {} let header = {}
// 添加签名和防重放攻击参数 // 添加签名和防重放攻击参数
@ -257,7 +246,7 @@ class RequestManager {
} }
console.log(requestUrl); console.log(requestUrl);
if (RequestManager.isUrlInWhitelist(requestUrl)) { if (RequestManager.isUrlInWhitelist(requestUrl)) {
reject(res.data) reject(res.data)
return; return;
} }

View File

@ -127,7 +127,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx683d8a8a499d7ec6", "appid" : "wx9ade414ae5755f0d",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : false, "es6" : false,

View File

@ -3,12 +3,10 @@
<banner :type-id="10" :height="326"></banner> <banner :type-id="10" :height="326"></banner>
<view style="padding-bottom: 300rpx; background-color: white;"> <view style="padding-bottom: 300rpx; background-color: white;">
<view class="" style="display: flex; flex-direction: column;"> <view class="" style="display: flex; flex-direction: column;">
<view class="grid-container" :style="datas.length === 0 ? 'display:flex;justify-content:center;align-items:center;' : ''"> <view class="grid-container">
<empty-state v-if="datas.length === 0" message="暂无商品数据"></empty-state> <view v-for="(item, index) in datas" :key="index" class="grid-item" @click="order_money(item)">
<view v-else v-for="(item, index) in datas" :key="index" class="grid-item" @click="order_money(item)">
<view class="" <view class="" style="background-color: #D8D8D8; height: 324rpx; border-radius: 16rpx 16rpx 0rpx 0rpx;">
style="background-color: #D8D8D8; height: 324rpx; border-radius: 16rpx 16rpx 0rpx 0rpx;">
<image :src="item.imgurl" <image :src="item.imgurl"
style=" width: 326.39rpx; height: 324rpx; position: absolute; left: 2rpx; border-radius: 16rpx" style=" width: 326.39rpx; height: 324rpx; position: absolute; left: 2rpx; border-radius: 16rpx"
mode=""> mode="">
@ -139,9 +137,7 @@
<script> <script>
export default { export default {
components: {
EmptyState: () => import('@/components/empty-state/empty-state.vue')
},
data() { data() {
return { return {
statusBarHeight: 0, statusBarHeight: 0,
@ -204,11 +200,6 @@ export default {
getData() { getData() {
let that = this let that = this
let isWXPay = this.$config.GetVersion()
if (isWXPay) {
that.datas = [];
return;
}
that.req({ that.req({
url: 'goods', url: 'goods',
data: { data: {
@ -218,7 +209,6 @@ export default {
use_integral_is: this.isWXPay ? 1 : 2, use_integral_is: this.isWXPay ? 1 : 2,
}, },
success(res) { success(res) {
that.datas = res.data.data that.datas = res.data.data
} }
}); });