Merge branch 'dev' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

master
sws 2023-10-31 13:40:54 +08:00
commit 5254c19f1c
10 changed files with 146 additions and 60 deletions

116
App.vue
View File

@ -66,14 +66,16 @@
weixin_privacy_setting_timer: null,
// 使0, 1线->->线 https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wx50b5593e81dd937a
is_weixin_open_location_use_plugins: 0,
// 0, 1APP
is_home_search_scan: 1,
// tabbar
tabbar_pages: ['/pages/index/index', '/pages/goods-category/goods-category', '/pages/cart/cart', '/pages/user/user'],
//
// request_url: 'https://new.shopxo.vip/',
request_url: 'http://shopxo.com/',
request_url: 'https://new.shopxo.vip/',
// request_url: 'http://shopxo.com/',
// publicpublichttps://d1.shopxo.vip/public/
// static_url: 'https://new.shopxo.vip/',
static_url: 'http://shopxo.com/',
static_url: 'https://new.shopxo.vip/',
// static_url: 'http://shopxo.com/',
// default
system_type: 'default',
//
@ -1119,12 +1121,21 @@
var is_redirect = parseInt(e.currentTarget.dataset.redirect || 0) == 1;
this.url_open(value, is_redirect);
},
// url
is_url(value) {
var arr = ['http:/', 'https:'];
return arr.indexOf(value.substr(0, 6)) != -1;
},
// page
is_page(value) {
var arr = ['/pages', 'pages/'];
return arr.indexOf(value.substr(0, 6)) != -1;
},
// url
url_open(value, is_redirect = false) {
if ((value || null) != null) {
// web
var http_arr = ['http:/', 'https:'];
if (http_arr.indexOf(value.substr(0, 6)) != -1) {
if (this.is_url(value)) {
this.open_web_view(value);
//
} else if (value.substr(0, 8) == 'appid://') {
@ -1144,26 +1155,30 @@
this.call_tel(value.substr(6));
//
} else {
if (this.is_tabbar_pages(value)) {
var temp = value.split('?');
if (temp.length > 1 && (temp[1] || null) != null) {
value = temp[0];
var query = this.url_params_to_json(temp[1]);
uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query);
}
uni.switchTab({
url: value,
});
} else {
if (is_redirect) {
uni.redirectTo({
if(this.is_page(value)) {
if (this.is_tabbar_pages(value)) {
var temp = value.split('?');
if (temp.length > 1 && (temp[1] || null) != null) {
value = temp[0];
var query = this.url_params_to_json(temp[1]);
uni.setStorageSync(this.data.cache_page_tabbar_switch_params, query);
}
uni.switchTab({
url: value,
});
} else {
uni.navigateTo({
url: value,
});
if (is_redirect) {
uni.redirectTo({
url: value,
});
} else {
uni.navigateTo({
url: value,
});
}
}
} else {
this.showToast('未知数据('+value+'');
}
}
}
@ -1937,6 +1952,63 @@
}
return width;
},
// weburlid
web_url_value_mate(url, rules) {
var value = null;
for(var i in rules) {
if(url.indexOf(rules[i]) != -1) {
var temp = url.split(rules[i]);
if(temp.length > 1) {
temp = temp[1].split('.');
if(temp.length > 0 && (temp[0] || null) != null) {
value = temp[0];
break;
}
}
}
}
return value;
},
//
scan_handle() {
var self = this;
uni.scanCode({
success: function (res) {
if(res.result !== '') {
var value = res.result;
// url
if(self.is_url(value)) {
//
var goods_arr = ['/goods-', '/goods/index/id/', '=goods/index/id/'];
var goods_id = self.web_url_value_mate(value, goods_arr);
if(goods_id != null) {
uni.navigateTo({
url: '/pages/goods-detail/goods-detail?id='+goods_id,
});
return;
}
//
var shop_arr = ['/shop-index-detail-', '/plugins/index/pluginsname/shop/pluginscontrol/index/pluginsaction/detail/id/', '=plugins/index/pluginsname/shop/pluginscontrol/index/pluginsaction/detail/id/'];
var shop_id = self.web_url_value_mate(value, shop_arr);
if(shop_id != null) {
uni.navigateTo({
url: '/pages/plugins/shop/detail/detail?id='+shop_id,
});
return;
}
// url
self.open_web_view(value);
} else {
self.url_open(value);
}
}
},
});
}
},
//
onLaunch(params) {},

View File

@ -186,8 +186,8 @@
.search-content .search-icon {
z-index: 1;
left: 20rpx;
top: calc(50% - 14rpx);
line-height: 22rpx;
top: calc(50% - 12rpx);
line-height: 26rpx;
}
.search-content input {

View File

@ -97,10 +97,6 @@
font-weight: 600;
}
.content-item .desc {
margin-bottom: 56rpx;
}
.content-item .icon {
width: 92rpx;
height: 92rpx;
@ -117,6 +113,13 @@
.model-one .content-item:nth-child(3n) {
border-right: 0;
}
.model-one .content .desc {
min-height: 52rpx;
line-height: 26rpx;
}
.model-one .content {
height: 240rpx;
}
.one-content image {

View File

@ -29,9 +29,9 @@
<view class="content-item cp" :data-value="item.id" @tap="category_event">
<view class="padding-sm">
<view class="content bg-white border-radius-main">
<image v-if="(item.icon || null) != null" :src="item.icon" mode="aspectFit" class="icon circle"></image>
<image v-if="(item[category_goods_model_icon_field] || null) != null" :src="item[category_goods_model_icon_field]" mode="aspectFit" class="icon circle"></image>
<view class="text single-text margin-top-sm" :class="'text-random-' + (Math.floor(Math.random() * 9) + 1)">{{ item.name }}</view>
<view class="desc single-text nargin-top-xs padding-top-xss cr-grey-9 text-size-xss">{{ item.describe }}</view>
<view class="desc multi-text margin-top-xs padding-top-xss cr-grey-9 text-size-xss">{{ item.describe }}</view>
</view>
</view>
</view>
@ -227,7 +227,7 @@
<block v-for="(v, index) in data_content.items" :key="index">
<view class="content-item tc cp two-img" :data-value="v.id" @tap="category_event">
<view class="content">
<image v-if="(v.icon || null) != null" :src="v.icon" mode="aspectFit" class="icon radius padding-bottom-main"></image>
<image v-if="(v.icon || null) != null" :src="v.icon" mode="aspectFit" class="icon radius margin-bottom-main"></image>
<view class="single-text text-size-sm cr-grey">{{ v.name }}</view>
</view>
</view>
@ -248,7 +248,7 @@
<block v-for="(vs, index2) in v.items" :key="index2">
<view class="content-item two-img tc cp" :data-value="vs.id" @tap="category_event">
<view class="content">
<image v-if="(vs.icon || null) != null" :src="vs.icon" mode="aspectFit" class="icon radius padding-bottom-main"></image>
<image v-if="(vs.icon || null) != null" :src="vs.icon" mode="aspectFit" class="icon radius margin-bottom-main"></image>
<view class="single-text text-size-sm cr-grey">{{ vs.name }}</view>
</view>
</view>

View File

@ -22,17 +22,28 @@
</view>
<!-- #endif -->
<view v-if="common_app_is_enable_search == 1" class="search-content-input dis-inline-block va-m" :style="top_content_search_style">
<component-search
propPlaceholder="输入商品名称搜索"
propPlaceholderClass="cr-white"
propIconColor="#fff"
propBgColor="rgb(255 255 255 / 0.5)"
<!-- #ifndef H5 -->
@onicon="search_icon_event"
propIcon="icon-mendian-sousuosm"
:propIsIconOnEvent="true"
<!-- #endif -->
></component-search>
<!-- 是否开启搜索框前面icon扫一扫 -->
<block v-if="is_home_search_scan == 1">
<component-search
propPlaceholder="输入商品名称搜索"
propPlaceholderClass="cr-white"
propIconColor="#fff"
propBgColor="rgb(255 255 255 / 0.5)"
<!-- #ifndef H5 -->
@onicon="search_icon_event"
propIcon="icon-mendian-sousuosm"
:propIsIconOnEvent="true"
<!-- #endif -->
></component-search>
</block>
<block v-else>
<component-search
propPlaceholder="输入商品名称搜索"
propPlaceholderClass="cr-white"
propIconColor="#fff"
propBgColor="rgb(255 255 255 / 0.5)"
></component-search>
</block>
</view>
<!-- #ifdef H5 || MP-TOUTIAO || APP -->
<!-- 右上角icon列表 -->
@ -329,6 +340,7 @@
data_bottom_line_status: false,
load_status: 0,
currency_symbol: app.globalData.data.currency_symbol,
is_home_search_scan: app.globalData.data.is_home_search_scan,
data_list: [],
banner_list: [],
navigation: [],
@ -635,13 +647,7 @@
// icon
search_icon_event(e) {
console.log(1)
uni.scanCode({
success: function (res) {
console.log(res.result)
app.globalData.open_web_view(res.result);
},
});
app.globalData.scan_handle();
}
}
};

View File

@ -20,7 +20,6 @@
<view class="form-gorup-title">昵称<text class="form-group-tips-must">*</text></view>
<view class="flex-row align-c flex-1 flex-width">
<input :type="application_client_type == 'weixin' ? 'nickname' : 'text'" name="nickname" :value="user_data.nickname || ''" maxlength="16" placeholder-class="cr-grey-9 tr" class="cr-base tr margin-right-sm" placeholder="昵称1~16个字符" />
<iconfont name="icon-qiandao-jiantou2" size="34rpx" color="#ccc"></iconfont>
</view>
</view>
@ -38,7 +37,6 @@
<view class="form-gorup-title">详细地址</view>
<view class="flex-row align-c flex-1 flex-width">
<input type="text" name="address" :value="user_data.address || ''" maxlength="30" placeholder-class="cr-grey-9 tr" class="cr-base tr margin-right-sm" placeholder="详细地址最多30个字符" />
<iconfont name="icon-qiandao-jiantou2" size="34rpx" color="#ccc"></iconfont>
</view>
</view>

View File

@ -36,10 +36,10 @@
<view v-if="data.is_reply && data.is_reply === '1'" class="padding-main br-t-dashed">
<view class="flex-row jc-sb align-c">
<view class="flex-row align-c">
<image :src="ask_static_url + 'admin.png'" mode="widthFix" class="admin-img margin-right-sm"></image>
<text>管理员</text>
<image v-if="(logo_square || null) != null" :src="logo_square" mode="widthFix" class="admin-img circle br-f5 margin-right-sm"></image>
<text>管理员回复</text>
</view>
<view class="cr-grey-9 text-size-xs">回复时间: {{ data.reply_time_date }}</view>
<view v-if="(data.reply_time_date || null) != null" class="cr-grey-9 text-size-xs">: {{ data.reply_time_date }}</view>
</view>
<view class="text-size-md padding-top-main">{{ data.reply }}</view>
</view>
@ -59,7 +59,7 @@
</view>
<view class="bottom-fixed ask-btn-content">
<view class="flex-row jc-sa align-c text-size fw-b bottom-line-exclude">
<navigator url="/pages/plugins/ask/user-form/user-form" hover-class="none" class="flex-1 tc flex-col jc-c align-c">
<navigator url="/pages/plugins/ask/form/form" hover-class="none" class="flex-1 tc flex-col jc-c align-c">
<view class="divider-r-d wh-auto">
<iconfont name="icon-wenda-wytw" size="30rpx" color="#333" class="margin-right-sm"></iconfont>
我要提问
@ -89,7 +89,7 @@
export default {
data() {
return {
ask_static_url: app.globalData.get_static_url('ask', true),
logo_square: app.globalData.get_application_logo_square(),
data_list_loding_status: 1,
data_bottom_line_status: true,
data: null,

View File

@ -45,7 +45,7 @@
</scroll-view>
<view class="bottom-fixed ask-btn-content">
<view class="flex-row jc-sa align-c text-size fw-b bottom-line-exclude">
<navigator url="/pages/plugins/ask/user-form/user-form" hover-class="none" class="flex-1 tc flex-col jc-c align-c">
<navigator url="/pages/plugins/ask/form/form" hover-class="none" class="flex-1 tc flex-col jc-c align-c">
<view class="divider-r-d wh-auto">
<iconfont name="icon-wenda-wytw" size="30rpx" color="#333" class="margin-right-sm"></iconfont>
我要提问

View File

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@ -6,9 +6,8 @@
<view class="padding-horizontal-main border-radius-main bg-white oh spacing-mb">
<view class="padding-top-xxl padding-bottom-xxl padding-right-xxxl arrow-right oh" data-value="/pages/personal/personal" @tap="url_event">
<image :src="user.avatar || default_avatar" mode="widthFix" class="circle br fl user-avatar"></image>
<view class="fl margin-left">
<view class="fl margin-left margin-top">
<view>{{ user.user_name_view || '用户名' }}</view>
<view v-if="(user || null) != null" class="br-main cr-main round tc padding-left-lg padding-right-lg margin-top-xs dis-inline-block">ID {{ user.id }}</view>
</view>
</view>
<view class="padding-top-xxl padding-bottom-xxl padding-right-xxxl arrow-right br-t" data-value="/pages/login/login?opt_form=bind_verify" @tap="url_event">