Compare commits
3 Commits
custom/com
...
zhu-kaijii
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a1f33323c | ||
|
|
b441c46993 | ||
| 8df59abd03 |
@@ -19,5 +19,10 @@ export const lang = {
|
||||
currencySymbol: '¥',
|
||||
submit: 'Submit',
|
||||
searchTip: 'Please enter search keywords'
|
||||
}
|
||||
},
|
||||
|
||||
login: 'Login/Register',
|
||||
loginTips: 'Click to login and enjoy more exciting information',
|
||||
toLogin: 'Go to login',
|
||||
toGoodsCategoryPage: 'Go shopping',
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ export const lang = {
|
||||
searchTip: '请输入搜索关键词'
|
||||
},
|
||||
|
||||
login: '登录/注册',
|
||||
loginTpis: '点击登录 享受更多精彩信息',
|
||||
toLogin: '去登录',
|
||||
toGoodsCategoryPage: '去逛逛',
|
||||
|
||||
waitpay: '待付款',
|
||||
waitsend: '待发货',
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
},
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : "/hwappx/common/"
|
||||
"base" : "/hwappx/2811/"
|
||||
},
|
||||
"title" : "",
|
||||
"devServer" : {
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -79,7 +79,7 @@
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
<image
|
||||
:src="$util.img('public/uniapp/index/discount.png')" />
|
||||
</view>
|
||||
@@ -95,7 +95,7 @@
|
||||
{{ parseFloat(item.member_price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -108,7 +108,7 @@
|
||||
{{ parseFloat(item.price).toFixed(2).split('.')[0] }}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(item.price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -175,7 +175,7 @@
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.member_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" />
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -185,7 +185,7 @@
|
||||
}}
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(goodsItem.discount_price).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
</template>
|
||||
</text>
|
||||
</view>
|
||||
@@ -199,9 +199,12 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty">
|
||||
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">去登录</button>
|
||||
<ns-empty text="购物车为空" subText="赶紧去逛逛, 购买心仪的商品吧" :isIndex="Boolean(storeToken)"
|
||||
:emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken" @click="toLogin">{{
|
||||
$lang('toLogin')
|
||||
}}</button>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
<ns-goods-recommend ref="goodrecommend" route="cart"></ns-goods-recommend>
|
||||
@@ -316,9 +319,9 @@
|
||||
<text class="unit price-font">{{ $lang('common.currencySymbol') }}</text>
|
||||
<block v-if="Object.keys(discount).length">
|
||||
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
|
||||
}}</text>
|
||||
}}</text>
|
||||
<text class="unit price-font">.{{ parseFloat(discount.order_money).toFixed(2).split('.')[1]
|
||||
}}</text>
|
||||
}}</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<text class="value price-font">{{ parseFloat(totalPrice).toFixed(2).split('.')[0] }}</text>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import common from './common.js';
|
||||
|
||||
export default {
|
||||
mixins: [common],
|
||||
data() {
|
||||
return {
|
||||
cartData: [], // 购物车
|
||||
@@ -444,9 +447,6 @@ export default {
|
||||
// });
|
||||
}
|
||||
},
|
||||
toLogin() {
|
||||
this.$refs.login.open();
|
||||
},
|
||||
// 重置编辑状态
|
||||
resetEditStatus() {
|
||||
if (this.cartData.length) {
|
||||
|
||||
8
pages_goods/public/js/common.js
Normal file
8
pages_goods/public/js/common.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
methods: {
|
||||
// 跳转至登录页
|
||||
toLogin() {
|
||||
this.$refs.login.open();
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh"
|
||||
v-if="storeToken">
|
||||
<view class="goods_list" slot="list">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh">
|
||||
<block class="goods_list" slot="list">
|
||||
<block v-if="collectionList.length > 0">
|
||||
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
|
||||
@click.stop="toDetail(item)">
|
||||
@@ -30,9 +29,15 @@
|
||||
</view>
|
||||
</block>
|
||||
<!-- 第一个列表为空时 -->
|
||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品" :isIndex="false"></ns-empty>
|
||||
<view class="collection-empty" v-else>
|
||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品"
|
||||
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend ref="goodsRecommend"></ns-goods-recommend>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -40,11 +45,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import common from './public/js/common.js';
|
||||
import collection from './public/js/collection.js';
|
||||
|
||||
export default {
|
||||
mixins: [collection],
|
||||
mixins: [common, collection],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
@@ -53,7 +58,7 @@ export default {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/collection');
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<view class="head-wrap" v-if="storeToken">
|
||||
<text @click="manageFootprint">{{ manage ? '完成' : '管理' }}</text>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx" v-if="storeToken">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx">
|
||||
<block slot="list">
|
||||
<view class="goods-list single-column" v-if="goodsList.length">
|
||||
<view class="goods-list single-column" v-if="goodsList.length > 0">
|
||||
<view v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="datetime">{{ datetime(item) }}</view>
|
||||
<view class="goods-item" :class="{ manage: manage }">
|
||||
@@ -45,7 +45,11 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else><ns-empty text="暂无浏览过的商品"></ns-empty></view>
|
||||
<view class="footprint-empty" v-else>
|
||||
<ns-empty text="暂无浏览过的商品" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||
</view>
|
||||
|
||||
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
||||
<view class="all-election" @click="allElection">
|
||||
@@ -65,7 +69,10 @@
|
||||
<script>
|
||||
var dateList = [];
|
||||
|
||||
import common from './public/js/common.js';
|
||||
|
||||
export default {
|
||||
mixins: [common],
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
@@ -81,7 +88,7 @@ export default {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/footprint');
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -108,9 +115,7 @@ export default {
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
console.log(`后台服务器返回的信息:${msg}`);
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
|
||||
@@ -99,3 +99,24 @@
|
||||
box-sizing: border-box;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.collection-empty {
|
||||
text-align: center;
|
||||
padding: 140rpx $padding 80rpx $padding;
|
||||
|
||||
image {
|
||||
width: 380rpx;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx !important;
|
||||
font-size: $font-size-base;
|
||||
border-radius: 50rpx;
|
||||
&.visit-the {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,27 @@
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
|
||||
.footprint-empty {
|
||||
text-align: center;
|
||||
padding: 140rpx $padding 80rpx $padding;
|
||||
|
||||
image {
|
||||
width: 380rpx;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx !important;
|
||||
font-size: $font-size-base;
|
||||
border-radius: 50rpx;
|
||||
&.visit-the {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lineheight-clear {
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
},
|
||||
async: false,
|
||||
}).then((res) => {
|
||||
let newArr = res.data.list;
|
||||
let newArr = res.data?.list || [];
|
||||
for (var i = 0; i < newArr.length; i++) {
|
||||
newArr[i].composite_score = Math.floor((parseFloat(newArr[i].shop_desccredit) + parseFloat(newArr[i].shop_servicecredit) + parseFloat(newArr[i].shop_deliverycredit)) / 3).toFixed(1);
|
||||
}
|
||||
|
||||
8
pages_tool/member/public/js/common.js
Normal file
8
pages_tool/member/public/js/common.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
methods: {
|
||||
// 跳转至登录页
|
||||
toLogin() {
|
||||
this.$refs.login.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
165
readme.md
165
readme.md
@@ -1,7 +1,5 @@
|
||||
# 小程序及快应用前端源码
|
||||
|
||||
来源于外包提供的源代码,"0731xcx20微信小程序(1).zip"
|
||||
|
||||
|
||||
## 项目说明
|
||||
|
||||
@@ -9,7 +7,7 @@
|
||||
|
||||
## 开发说明
|
||||
|
||||
1. 源码基于Vue2版本,scss采用node-sass进行编译输出。
|
||||
源码基于Vue2版本,scss采用dart-sass进行编译输出。
|
||||
|
||||
|
||||
## 开发调试说明
|
||||
@@ -18,7 +16,7 @@
|
||||
|
||||
应用访问等关键参数的配置来源于 `./common/js/config.js`
|
||||
|
||||
### 小程序调试
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,93 +24,90 @@
|
||||
|
||||
### 小程序发布
|
||||
|
||||
基本操作步骤:
|
||||
|
||||
1. 使用HBuilderX打开项目
|
||||
2. 选择菜单栏 "发行" -> "小程序-微信",进行发布构建
|
||||
3. 然后在终端进入项目根目录,执行 `npm run mp-weixin` 手动输出构建包。例如:mp-weixin-2025-10-31-1761881054836.zip
|
||||
4. 然后将mp-weixin-2025-10-31-1761881054836发给微信开发定制客户技术人员,
|
||||
5. 定制客户技术人员可以修改解压后,修改项目根目录下的site.js,进行针对客户的信息配置,然后使用微信开发者工具打开发布后的代码进行上传发布
|
||||
|
||||
参照:`common\js\config.js` 文件内容说明:
|
||||
|
||||
```js
|
||||
// 发行版本,配置说明
|
||||
let releaseCfg = undefined;
|
||||
try {
|
||||
if (site) {
|
||||
releaseCfg = {
|
||||
baseUrl: site.baseUrl,
|
||||
imgDomain: site.baseUrl,
|
||||
h5Domain: site.baseUrl,
|
||||
uniacid: site.uniacid,
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
// 调试版本,配置说明
|
||||
const devCfg = {
|
||||
// 商户ID
|
||||
uniacid: 460, //825
|
||||
|
||||
//api请求地址
|
||||
baseUrl: 'https://xcx30.5g-quickapp.com/',
|
||||
|
||||
// 图片域名
|
||||
imgDomain: 'https://xcx30.5g-quickapp.com/',
|
||||
|
||||
// H5端域名
|
||||
h5Domain: 'https://xcx30.5g-quickapp.com/',
|
||||
|
||||
// // api请求地址
|
||||
// baseUrl: 'https://tsaas.liveplatform.cn/',
|
||||
|
||||
// // 图片域名
|
||||
// imgDomain: 'https://tsaas.liveplatform.cn/',
|
||||
|
||||
// // H5端域名
|
||||
// h5Domain: 'https://tsaas.liveplatform.cn/',
|
||||
|
||||
// api请求地址
|
||||
// baseUrl: 'http://saas.cn/',
|
||||
|
||||
// // 图片域名
|
||||
// imgDomain: 'http://saas.cn/',
|
||||
|
||||
// // H5端域名
|
||||
// h5Domain: 'http://saas.cn/',
|
||||
};
|
||||
|
||||
var config = {
|
||||
/**
|
||||
* 1.开发调试模式
|
||||
* 去掉注释 ...devCfg;
|
||||
* 注释掉 ...releaseCfg,
|
||||
* 2.发行/发布模式,例如通过`HBuilder>发行>小程序微信`的时候,原理
|
||||
* 然后将 `import site from "../site.js";`追加到 `unpackage\dist\build\mp-weixin\common\vendor.js` 文件内容开头部分
|
||||
* 然后将 site.js 文件放到 `unpackage\dist\build\mp-weixin\` 目录下面
|
||||
*/
|
||||
...(releaseCfg ?? devCfg),
|
||||
|
||||
|
||||
// 腾讯地图key
|
||||
mpKey: 'TUHBZ-CNWKU-UHAVP-GZQ26-HNZFO-3YBF4',
|
||||
#### 基本操作步骤:(通用版/定制化版)
|
||||
|
||||
#### 【前置准备】
|
||||
1. 在项目根目录打开终端安装依赖“npm install”(已有依赖可跳过此步骤)。
|
||||
#### 【发布构建】
|
||||
2. 使用HBuilderX打开项目;
|
||||
3. 选择菜单栏「发行」 → 「小程序-微信」→ 「发行」,等待构建完成。(⚠️注:底部控制台弹出"请在微信小程序开发者工具中点击上传"后再执行下一步);
|
||||
4. 打开资源管理器→项目根目录,右键选择「在终端中打开」,执行"npm run mp-weixin"命令并回车;
|
||||
|
||||
5. 找到项目根目录 /unpackage/dist/build 下生成的 mp-weixin 压缩包
|
||||
|
||||
💡例如:mp-weixin-2026-01-23-1769152056146.zip;同时该目录下会生成未压缩的 mp-weixin 目录。
|
||||
|
||||
#### 【验证与重命名】
|
||||
6. 打开该目录下同时生成未压缩的 mp-weixin 目录,找到site.js文件,将文件内的uniacid值改为当前客户编号(如:2812)并保存;
|
||||
7. 打开微信开发者工具,导入「mp-weixin」目录,点击「编译」,在开发者工具控制台验证有无报错,以及能否返回对应客户的业务数据;
|
||||
|
||||
8. 确保无误后将生成的mp-weixin的压缩包重命名,格式为:定制化-客户编号-域名-mp-weixin-当前日期-生成编号.zip。
|
||||
***(📌通用版无需重命名)***
|
||||
|
||||
💡例如:custom-2812-xcx.aigc-quickapp.com-mp-weixin-2026-01-22-1769152056146.zip
|
||||
|
||||
🚫压缩包命名禁止包含 / \ : * ? " < > | 等特殊字符。
|
||||
|
||||
|
||||
#### 【交付与最终发布】🔍🔍
|
||||
9. 将重命名后的文件发送给技术人员; ***(📌通用版直接将生成的 mp-weixin 压缩包直接发送给技术人员)***
|
||||
|
||||
10. 技术人员操作:解压压缩包 → 确认site.js中的uniacid为客户编号 → 用微信开发者工具导入解压后的代码目录 → 编译验证无误后 → 上传发布。
|
||||
|
||||
//客服地址
|
||||
webSocket: '{{$webSocket}}',
|
||||
|
||||
//本地端主动给服务器ping的时间, 0 则不开启 , 单位秒
|
||||
pingInterval: 1500,
|
||||
|
||||
// 版本号
|
||||
version: '1.0'
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
||||
|
||||
### 快应用发布
|
||||
1. 使用HBuilderX打开项目
|
||||
2. 选择菜单栏 "发行" -> "快应用",进行发布构建
|
||||
3. 使用快应用开发者工具打开发布后的代码进行上传发布
|
||||
|
||||
|
||||
#### 基本操作(通用版/定制化版)
|
||||
|
||||
|
||||
|
||||
#### 【发布构建】
|
||||
1. 使用HBuilderX打开项目;
|
||||
|
||||
2. 打开项目根目录的manifest.json文件,切换至可视化配置界面:依次点击「Web 配置」→「运行的基础配置」,修改路径中的客户编号;***(📌通用版保留原有/hwappx/common/)***
|
||||
|
||||
💡例如:/hwappx/2811/,其中2811为定制化版客户编号;
|
||||
|
||||
3. 选择菜单栏「发行」 → 「自定义发行」 →「H5-xcx.aigc-quickapp.com」,先修改以下配置:
|
||||
网站标题:快应用
|
||||
网站域名:当前客户域名(示例:xcx.aigc-quickapp.com)
|
||||
确认后点击「发行」等待构建完成。
|
||||
|
||||
⚠️注:底部控制台弹出“项目 lucky_shop 导出Web成功,路径为:D:\项目文件\项目根目录\unpackage\dist\build\web”后再执行下一步
|
||||
|
||||
💡例如:项目 lucky_shop 导出Web成功,路径为:D:\0.项目源码\lucky_shop\unpackage\dist\build\web
|
||||
|
||||
4. 按控制台提示的路径找到web目录,将该目录下所有文件手动打包成一个.zip压缩包(仅打包文件,不包含外层web目录);
|
||||
|
||||
#### 【重命名】
|
||||
5. 按版本类型规范重命名压缩包:
|
||||
|
||||
📌通用版:hwappx-common-域名-时间.zip
|
||||
例如: hwappx-common-xcx.aigc-quickapp.com-2026-01-24.zip
|
||||
|
||||
📌定制化:客户名称-定制化---hwappx-客户编号-域名-时间.zip
|
||||
例如:POCT检测分析平台-定制化---hwappx-2811-xcx.aigc-quickapp.com-2026-01-24.zip
|
||||
|
||||
🚫压缩包命名禁止包含 / \ : * ? " < > | 等特殊字符
|
||||
|
||||
#### 【交付与最终发布】🔍🔍
|
||||
6. 将重命名后的压缩包发送给运维人员;
|
||||
|
||||
7. 运维人员操作:
|
||||
|
||||
① 解压压缩包;
|
||||
|
||||
② 打开快应用开发者工具,导入解压后的代码目录;
|
||||
|
||||
③ 验证代码无报错后,执行上传发布操作。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user