From 2da5869dd6178470a248b69e8e808c3fb4c2bd02 Mon Sep 17 00:00:00 2001
From: shuxiaoquan <853623962@qq.com>
Date: Tue, 6 Feb 2024 17:27:04 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96=E4=B8=8E?=
=?UTF-8?q?=E6=96=87=E7=AB=A0=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/article/index.js | 14 +-
api/goods/index.js | 5 +
pages.json | 2 +-
pages/activity/newPeople.vue | 17 +-
pages/activity/newsshop.vue | 5 +-
pages/activity/presale.vue | 2 +-
pages/activity/presaleRule.vue | 5 -
pages/activity/ranking.vue | 3 +-
pages/activity/seckill.vue | 3 +-
pages/index/index.vue | 84 ++++++----
pages/news/article/add.vue | 114 ++++++++++++--
pages/news/article/classify.vue | 48 +++++-
pages/news/article/detail.vue | 2 +-
pages/news/article/index.vue | 42 ++---
pages/news/coupon/index.vue | 4 +-
pages/news/park/browsingHistory.vue | 168 +++++++++++++++-----
pages/serve/pay.vue | 234 ++++++++++++++++++++++++++++
pages/user/vip/goods.vue | 12 +-
utils/request/index.js | 2 +-
19 files changed, 623 insertions(+), 143 deletions(-)
create mode 100644 pages/serve/pay.vue
diff --git a/api/article/index.js b/api/article/index.js
index 1914fcb..892b1f7 100644
--- a/api/article/index.js
+++ b/api/article/index.js
@@ -4,14 +4,18 @@ import request from '@/utils/request'
const api = {
list: 'article/list',
detail: 'article/detail',
- del: 'storeKeeper/articleDelete',
- edit: 'storeKeeper/articleEdit',
- add: 'storeKeeper/articleAdd',
+ del: 'article/delete',
+ edit: 'article/edit',
+ add: 'article/add',
articleCatList: 'article.category/list',
- articleCatAdd: 'storeKeeper/articleCatAdd',
- articleCatDelete: 'storeKeeper/articleCatDelete',
+ articleCatAdd: 'article/addCategory',
+ articleCatDelete: 'article/articleCatDelete',
articleCatEdit: 'storeKeeper/articleCatEdit'
}
+// 文章分类列表 新增
+export function articleCatAdd(param, option) {
+ return request.post(api.articleCatAdd, param, option)
+}
// 文章分类列表
export function articleCatList(param, option) {
return request.get(api.articleCatList, param, option)
diff --git a/api/goods/index.js b/api/goods/index.js
index 741348e..ed4ab14 100644
--- a/api/goods/index.js
+++ b/api/goods/index.js
@@ -17,6 +17,11 @@ const api = {
export const browseHistoryList = (param, option) => {
return request.get('goods/browseLog', param, option)
}
+
+// 商品浏览记录 删除
+export const browseHistoryDel = (param, option) => {
+ return request.post('goods/browseDel', param, option)
+}
// 取消预约
export const canlpresale = (data) => {
diff --git a/pages.json b/pages.json
index ae7d714..8621520 100644
--- a/pages.json
+++ b/pages.json
@@ -531,7 +531,7 @@
{
"path": "article/detail",
"style": {
- "navigationBarTitleText": "文章详情",
+ "navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
diff --git a/pages/activity/newPeople.vue b/pages/activity/newPeople.vue
index c6cb1a6..5f33273 100644
--- a/pages/activity/newPeople.vue
+++ b/pages/activity/newPeople.vue
@@ -35,19 +35,18 @@
¥{{item.goods_price_min}}
- 200+条评论 99%好评率
+ {{item.goods_sales}}+条评论 {{item.remaizhishu}}%好评率
-
+
@@ -255,12 +243,16 @@
color: #3B3B3B;
}
.desc{
+ font-size: 26rpx;
+ color: #999;
+ height: 100rpx;
+ line-height: 50rpx;
word-break: break-all;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
}
}
}
diff --git a/pages/news/coupon/index.vue b/pages/news/coupon/index.vue
index db58136..f45e714 100644
--- a/pages/news/coupon/index.vue
+++ b/pages/news/coupon/index.vue
@@ -1,7 +1,7 @@
-
+
商品券
@@ -228,11 +228,11 @@
justify-content: center;
align-items: center;
font-size: 36rpx;
- font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FA3B22;
line-height: 148rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #FEEECA 100%);
+ z-index: 999;
.fooIcon{
margin-left: 36rpx;
}
diff --git a/pages/news/park/browsingHistory.vue b/pages/news/park/browsingHistory.vue
index ef3f020..2903264 100644
--- a/pages/news/park/browsingHistory.vue
+++ b/pages/news/park/browsingHistory.vue
@@ -1,43 +1,44 @@
- {{isToggle?'操作':'编辑'}}
+ {{isToggle?'操作':'编辑'}}
-
- 今天
-
+
+ {{a.week == '今天'?a.week: a.name}}
+
-
-
-
+
+
+
-
-
+
+
-
- 荣耀畅玩 40 Plus 全网通5G版 绿8GB+128GB
-
- 绿 8GB+128GB选服务
+
+ {{b.goods.goods_name}}
+
+ {{b.skustr}}
+
- ¥1120
+ ¥{{b.goods.goods_price_min}}
-
+
-
-
-
- 全选
+
+
+
+ 全选
- 共0件商品
- 删除
+ 共{{goodsids.length}}件商品
+ 删除
@@ -48,9 +49,11 @@
data() {
return {
isToggle: false,
+ isSelect: false,
list: [],
- total: 1,
+ isShow: false,
pageNum: 1,
+ goodsids: [],
options: [
{
text: '删除',
@@ -61,34 +64,124 @@
],
};
},
- onReady() {
+ onShow() {
this.getBrowseHistoryList();
},
- onReachBottom() {
- if(this.list.length <= this.total){
- uni.showLoading({
- title:"加载中"
- })
- this.pageNum ++;
- this.getBrowseHistoryList();
- }
- },
methods: {
+ openPage(index,i,k){
+ const that = this;
+ if(index == 1){
+ this.isToggle = !this.isToggle
+ }else if(index == 2){
+ uni.showModal({
+ title: "温馨提示",
+ content: "确定要全部删除吗?",
+ confirmColor: "#FF564A",
+ complete(res) {
+ that.toDel()
+ }
+ })
+ }else if(index == 3){
+ if(this.list && this.list.length >0){
+ this.list.map(a=>{
+ if(a.list && a.list.length > 0){
+ a.list.map(b=>{
+ if(that.isSelect == false){
+ b.isSelect = true
+ }else {
+ b.isSelect = false
+ }
+ })
+ }
+ })
+ }
+ that.isSelect = !that.isSelect
+ this.totallGoods();
+ }else if(index == 4){
+ this.list[i].list[k].isSelect = !this.list[i].list[k].isSelect
+ this.totallGoods();
+ }else if(index == 5){
+ uni.navigateTo({
+ url: "/pages/goods/detail?goodsId="+i
+ })
+ }
+ },
+ //统计选中多少商品
+ totallGoods() {
+ let arr = []
+ if(this.list && this.list.length >0){
+ this.list.map(a=>{
+ if(a.list && a.list.length > 0){
+ a.list.map(b=>{
+ if(b.isSelect){
+ arr.push(b.id)
+ }
+ })
+ }
+ })
+ }
+ this.goodsids = Array.from(new Set(arr));
+ },
+ //删除
+ async toDel() {
+ const that = this;
+ const {status, data} = await GoodsApi.browseHistoryDel({
+ ids: this.goodsids
+ })
+ if(status == 200){
+ uni.showToast({
+ title: "删除成功"
+ })
+ setTimeout(()=>{
+ that.getBrowseHistoryList();
+ },1000)
+ }
+ },
/**
* 获取浏览记录列表
*/
async getBrowseHistoryList() {
- const {status, data} = await GoodsApi.browseHistoryList({
+ let {status, data} = await GoodsApi.browseHistoryList({
page: this.pageNum
})
if(status == 200){
uni.hideLoading();
- this.list = this.list.concat(data.list.data)
- this.total = data.list.total
+ if(data && data.length > 0){
+ data.map(a=>{
+ if(a.list && a.list.length > 0){
+ a.list.map(b=>{
+ b.isSelect = false;
+ b.imgs = ""
+ if(b.images && b.images.length > 0){
+ b.imgs = b.images[0].file.external_url
+ }
+ b.skustr = ""
+ if(b.sku){
+ if(b.sku.goods_props && b.sku.goods_props.length>0){
+ b.sku.goods_props.map(c=>{
+ b.skustr+= c.value.name
+ })
+ }
+ }
+ })
+ }
+ })
+ }
+ this.list = data;
+ this.isShow = data && data.length > 0?false:true
}
},
- clickItem(idx,index){
- console.log(idx,index)
+ clickItem(idx,id){
+ const that = this;
+ uni.showModal({
+ title: "温馨提示",
+ content: "确定要删除吗?",
+ confirmColor: "#FF564A",
+ complete(res) {
+ that.goodsids = id;
+ that.toDel()
+ }
+ })
}
}
}
@@ -196,6 +289,7 @@
font-weight: 400;
color: #000000;
height: 80rpx;
+ overflow: hidden;
}
.sku{
width: 320rpx;
diff --git a/pages/serve/pay.vue b/pages/serve/pay.vue
new file mode 100644
index 0000000..bd527f0
--- /dev/null
+++ b/pages/serve/pay.vue
@@ -0,0 +1,234 @@
+
+
+
+ 订单号:{{order_id}}
+ 支付价格:¥{{orderInfo.pay_price}}元
+
+
+ 选择支付方式
+
+
+
+ {{a.method == 'wechat'?'微信支付':'余额支付'}}(余额:{{userInfo.balance}})
+
+
+ 确认支付
+
+
+
+
+
+
diff --git a/pages/user/vip/goods.vue b/pages/user/vip/goods.vue
index f3d460a..3c0106d 100644
--- a/pages/user/vip/goods.vue
+++ b/pages/user/vip/goods.vue
@@ -2,7 +2,7 @@
-
+
@@ -149,7 +149,12 @@
},
goodsDetail(orderId) {
uni.navigateTo({
- url: '/pages/goods/detail?orderId=' + orderId
+ url: '/pages/goods/detail?goodsId=' + orderId
+ })
+ },
+ openPage() {
+ uni.navigateTo({
+ url: "/pages/search/index"
})
},
}
@@ -166,7 +171,6 @@
&-hd {
width: 100%;
height: 400rpx;
-
image {
width: 100%;
height: 100%;
@@ -213,7 +217,7 @@
&-bd {
padding: 30rpx 0 0;
display: flex;
- height: calc(100vh - 700rpx);
+ height: calc(100vh - 750rpx);
box-sizing: border-box;
overflow: hidden;
diff --git a/utils/request/index.js b/utils/request/index.js
index 1bd056e..955be17 100644
--- a/utils/request/index.js
+++ b/utils/request/index.js
@@ -130,7 +130,7 @@ $http.dataFactory = async res => {
// 返回正确的结果(then接受数据)
return Promise.resolve(httpData)
}
-
+
// 判断是否需要登录
if (httpData.status == 401) {
// 401也有可能是后端登录态到期, 所以要清空本地的登录状态