Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
e9e29550
Commit
e9e29550
authored
Aug 06, 2024
by
石建新(贵阳日报)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
ed65be72
855d089f
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
245 additions
and
61 deletions
+245
-61
App.vue
src/App.vue
+10
-1
order.js
src/api/order.js
+8
-1
pages.json
src/pages.json
+2
-1
index.vue
src/pages/index/index.vue
+6
-0
afterSales.vue
src/pages/order/afterSales.vue
+5
-5
order.vue
src/pages/order/order.vue
+22
-4
refund.vue
src/pages/order/refund.vue
+58
-4
remark.vue
src/pages/order/remark.vue
+110
-37
ticket.vue
src/pages/ticket/ticket.vue
+22
-7
request.js
src/utils/request.js
+1
-0
yarn.lock
yarn.lock
+1
-1
No files found.
src/App.vue
View file @
e9e29550
...
...
@@ -4,6 +4,9 @@ import { sgyOrderGetStatus } from './api/order';
import
testJson
from
'./static/json/test.json'
;
import
{
getToken
}
from
'./utils/auth'
;
import
{
setOrderDic
}
from
'./utils/orderDic'
;
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch
(()
=>
{
if
(
!
getToken
())
signIn
();
sgyOrderGetStatus
().
then
((
res
)
=>
{
...
...
@@ -22,13 +25,19 @@ onHide(() => {
});
// 登录
const
signIn
=
()
=>
{
getTokenUser
(
testJson
).
then
((
res
)
=>
{
xma
.
xh
.
getUserProfile
({
range
:
[
'ACCOUNT'
,
'MOBILE'
,
'CITIZEN'
],
async
success
(
info
)
{
const
info2
=
JSON
.
stringify
(
info
);
getTokenUser
(
info2
).
then
((
res
)
=>
{
const
token
=
res
.
data
.
access_token
;
const
userInfo
=
res
.
data
.
user_info
;
xma
.
setStorageSync
(
'Authorization'
,
token
);
xma
.
setStorageSync
(
'userInfo'
,
userInfo
);
console
.
log
(
'登录...'
);
});
},
});
};
</
script
>
<
style
>
...
...
src/api/order.js
View file @
e9e29550
...
...
@@ -79,7 +79,14 @@ export function applyForARefundApi(data) {
data
,
});
}
// 新增订单评价
export
function
evaluation
(
data
)
{
return
request
({
url
:
'/sgyrdd/evaluation/eval'
,
method
:
'post'
,
data
,
});
}
export
function
afterSale
(
data
)
{
return
request
({
url
:
'/sgyrdd/sgyOrder/afterSales/getInfo'
,
...
...
src/pages.json
View file @
e9e29550
...
...
@@ -9,7 +9,8 @@
{
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationBarTitleText"
:
"小程序平台"
"navigationBarTitleText"
:
"小程序平台"
,
"navigationStyle"
:
"custom"
}
},
{
...
...
src/pages/index/index.vue
View file @
e9e29550
...
...
@@ -322,6 +322,12 @@ const reset = () => {
cardData2
.
value
=
[];
show
.
value
=
false
;
};
const
toUse
=
()
=>
{
xma
.
navigateTo
({
url
:
'/pages/index/listFood?type=1'
,
});
};
// 商家列表分页-搜索列表
const
getMerchantList
=
()
=>
{
xma
.
showLoading
({
...
...
src/pages/order/afterSales.vue
View file @
e9e29550
...
...
@@ -3,7 +3,7 @@
<Header
title=
"售后详情"
></Header>
<view
class=
"content"
>
<view
class=
"box box1"
>
<view
class=
"box box1"
v-if=
"afterSaleDetail"
>
<view
class=
"money"
>
<view
class=
"money_l"
>
退款金额
</view>
<view
class=
"money_r"
>
¥
{{
afterSaleDetail
.
refundPrice
}}
</view>
...
...
@@ -20,11 +20,11 @@
</view>
</view>
</view>
<view
class=
"box"
>
<view
class=
"box"
v-if=
"orderItems"
>
<view
class=
"goods"
>
<view
class=
"g1"
>
退款信息
</view>
<view
class=
"g2"
v-for=
"(item, index) in orderItems"
:key=
"index"
>
<img
:src=
"fileDomain + item.pic"
/>
<img
:src=
"fileDomain + item.pic"
mode=
"aspectFill"
/>
<view
class=
"g2_item"
>
<view
class=
"g2_info"
>
<view
class=
"g2_name"
>
{{
item
.
prodName
}}
</view>
...
...
@@ -68,8 +68,8 @@ const getAterSaleDetail = async (id) => {
orderItems
.
value
=
res
.
data
[
0
].
orderItems
;
};
onLoad
((
options
)
=>
{
//
orderNumber.value = options.orderNumber;
getAterSaleDetail
(
'NEONO-2024080113095213631'
);
orderNumber
.
value
=
options
.
orderNumber
;
getAterSaleDetail
(
orderNumber
.
value
);
});
</
script
>
...
...
src/pages/order/order.vue
View file @
e9e29550
...
...
@@ -63,7 +63,13 @@
评价
</view>
<view
class=
"btn-info"
@
tap=
"callShopPhone(item.shopTel)"
>
联系商家
</view>
<view
class=
"btn-error"
v-if=
"item.status == 7"
>
售后详情
</view>
<view
class=
"btn-error"
v-if=
"item.status === 'after_sales'"
@
tap=
"handleAfterSales(item)"
>
售后详情
</view>
<view
class=
"btn-error"
v-if=
"
...
...
@@ -117,12 +123,15 @@ import { getOrderDic } from '@/utils/orderDic';
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
const
stateList
=
ref
();
onLoad
(()
=>
{
onLoad
((
options
)
=>
{
const
orderDic
=
getOrderDic
();
stateList
.
value
=
orderDic
.
reduce
((
obj
,
item
)
=>
{
obj
[
item
.
baseStatus
]
=
item
;
return
obj
;
},
{});
if
(
options
.
status
)
{
tab
.
value
=
options
.
status
;
}
getList
();
});
...
...
@@ -152,7 +161,7 @@ const tabs = ref([
value
:
'after_sales'
,
},
]);
const
tab
=
ref
(
'
0
'
);
const
tab
=
ref
(
'
all
'
);
onShow
(()
=>
{
if
(
pendingPaymentOrder
.
value
)
{
...
...
@@ -230,6 +239,9 @@ const getList = async () => {
state
.
value
=
'finished'
;
};
/**
* 切换状态栏
*/
const
handleChange
=
(
e
)
=>
{
tab
.
value
=
e
.
name
;
initDataList
();
...
...
@@ -382,7 +394,7 @@ const handleQrcode = (item) => {
};
/**
*
售后详情
*
订单评价
*/
const
handleRemark
=
(
item
)
=>
{
xma
.
navigateTo
({
...
...
@@ -390,6 +402,12 @@ const handleRemark = (item) => {
});
};
const
handleAfterSales
=
(
item
)
=>
{
xma
.
navigateTo
({
url
:
`/pages/order/afterSales?orderNumber=
${
item
.
orderNumber
}
`
,
});
};
/**
* 申请退款
*/
...
...
src/pages/order/refund.vue
View file @
e9e29550
...
...
@@ -47,13 +47,14 @@
<view
class=
"content-between"
@
tap=
"showPop = true"
>
<text>
退款原因
</text>
<view
class=
"rightbox"
>
<text>
选择退款原因
</text>
<text
v-if=
"selectType"
>
{{
reasonList
[
selectType
].
name
}}
</text>
<text
v-else
>
选择退款原因
</text>
<wd-icon
name=
"arrow-right"
size=
"22px"
></wd-icon>
</view>
</view>
</view>
<view
class=
"btn"
>
提交
</view>
<view
class=
"btn"
@
tap=
"submit"
>
提交
</view>
</view>
</view>
<wd-popup
...
...
@@ -88,7 +89,7 @@
placeholder-style=
"font-size:28rpx;color: #c0c4cc;"
></textarea>
</radio-group>
<view
class=
"btn"
>
确认
</view>
<view
class=
"btn"
@
tap=
"chooseReason"
>
确认
</view>
</view>
</wd-popup>
</
template
>
...
...
@@ -121,7 +122,7 @@ function handleChange({ fileList: files }) {
}
const
showPop
=
ref
(
false
);
const
selectType
=
ref
(
0
);
const
selectType
=
ref
(
null
);
const
reasonList
=
ref
([
{
id
:
'0'
,
...
...
@@ -149,6 +150,59 @@ function radioChange(evt) {
const
{
value
}
=
evt
.
detail
;
selectType
.
value
=
value
;
}
const
submit
=
async
()
=>
{
if
(
!
selectType
.
value
)
{
return
xma
.
showToast
({
title
:
'请选择退款原因'
,
icon
:
'none'
,
});
}
if
(
selectType
.
value
===
'4'
&&
!
otherReason
.
value
)
{
return
xma
.
showToast
({
title
:
'请输入其他原因'
,
icon
:
'none'
,
});
}
xma
.
showLoading
({
title
:
'提交中'
,
mask
:
true
,
});
await
applyForARefundApi
({
orderNumber
:
orderNumber
.
value
,
refundMemo
:
selectType
.
value
===
4
?
otherReason
.
value
:
reasonList
.
value
[
selectType
.
value
].
name
,
imgs
:
fileList
.
value
.
map
((
item
)
=>
item
.
url
),
});
setTimeout
(()
=>
{
xma
.
hideLoading
();
setTimeout
(()
=>
{
xma
.
showToast
({
title
:
'提交成功'
,
icon
:
'success'
,
});
},
500
);
xma
.
redirectTo
({
url
:
`/pages/order/order?status=after_sales`
,
});
},
1500
);
};
const
chooseReason
=
()
=>
{
if
(
!
selectType
.
value
)
{
return
xma
.
showToast
({
title
:
'请选择退款原因'
,
icon
:
'none'
,
});
}
if
(
selectType
.
value
===
'4'
&&
!
otherReason
.
value
)
{
return
xma
.
showToast
({
title
:
'请输入其他原因'
,
icon
:
'none'
,
});
}
showPop
.
value
=
false
;
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/order/remark.vue
View file @
e9e29550
...
...
@@ -2,76 +2,132 @@
<view
class=
"container"
>
<Header
title=
"评论"
></Header>
<view
class=
"content"
>
<wd-form
ref=
"form"
:model=
"
model
"
:rules=
"rules"
class=
"remake"
>
<text
class=
"textarea"
>
老凯里酸汤鱼
</text>
<wd-form
ref=
"form"
:model=
"
formdata
"
:rules=
"rules"
class=
"remake"
>
<text
class=
"textarea"
>
{{
shopname
}}
</text>
<view
class=
"itemPicker"
>
<view
class=
"item01"
>
<text
class=
"label"
>
评分
</text>
<wd-rate
v-model=
"pinfen"
active-color=
"#ff0000"
size=
"50rpx"
space=
"10px"
/>
<wd-rate
prop=
"merchantServices"
v-model=
"formdata.merchantServices"
active-color=
"#ff0000"
size=
"50rpx"
space=
"10px"
@
change=
"handlemerchant"
/>
</view>
<view
class=
"item02"
>
<text>
非常满意
</text>
<text>
{{
merList
[
formdata
.
merchantServices
]
}}
</text>
</view>
</view>
<wd-textarea
v-model=
"pingjia"
placeholder=
"亲,分享您的看法,给其他人一个参考哦!"
/>
<wd-textarea
prop=
"evaluation"
v-model=
"formdata.evaluation"
placeholder=
"亲,分享您的看法,给其他人一个参考哦!"
:rules=
"[
{ required: true, message: '请填写你的评价' }]"
/>
<text
class=
"textarea"
>
上传图片/视频
</text>
<wd-upload
class=
"wdUpload"
accept=
"media"
multiple
:file-list=
"fileList"
:action=
"action"
@
change=
"handleChange"
:action=
"fileUPload"
@
change=
"handleFile"
></wd-upload>
<view
class=
"tuijian"
>
<!--
<view
class=
"tuijian"
v-if=
"show"
>
<view
class=
"tjTitle"
>
<text
class=
"textarea"
>
我要推荐菜
</text>
<text
class=
"textRight"
>
查看全部(30)
<i></i
>
<wd-icon
name=
"arrow-right"
></wd-icon
>
</text>
</view>
<view
class=
"itemtuijianList"
>
<wd-button
type=
"success"
plain
classPrefix=
"fish"
icon=
"kehuishouwu"
>
主要按钮
</wd-button>
</view>
</view>
<wd-cell
title=
"开启折扣"
title-width=
"100px"
prop=
"switchVal"
center
>
<view
style=
"text-align: left"
>
<wd-switch
v-model=
"mode.switchVal"
/>
<wd-checkbox-group
shape=
"button"
>
<wd-checkbox
modelValue=
"jingmai"
checked-color=
"#f00"
shape=
"button"
></wd-checkbox>
<wd-checkbox
modelValue=
"asd"
shape=
"button"
>
沃特
</wd-checkbox>
</wd-checkbox-group>
</view>
</view>
-->
<wd-cell
title=
"匿名评价"
prop=
"isAnonymous"
class=
"itemSwichval"
>
<wd-switch
size=
"48rpx"
active-color=
"#EC1B1B"
v-model=
"formdata.isAnonymous"
active-value=
"1"
inactive-value=
"0"
/>
</wd-cell>
</wd-form>
<wd-button
type=
"error"
block
>
发布
</wd-button>
<wd-button
type=
"error"
block
@
click=
"handleSubmit"
>
发布
</wd-button>
</view>
</view>
</
template
>
<
script
setup
lang=
"ts"
>
import
Header
from
'./components/Header/index.vue'
;
import
{
evaluation
}
from
'@/api/order'
;
const
form
=
ref
();
/**
* options
*/
const
shopname
=
ref
<
string
>
(
''
);
onLoad
((
options
)
=>
{
shopname
.
value
=
options
?.
shopName
;
formdata
.
orderNumber
=
options
?.
orderNumber
;
});
const
pinfen
=
ref
<
number
>
(
0
);
function
changeValue
({
pinfen
})
{
console
.
log
(
pinfen
);
}
const
pingjia
=
ref
<
string
>
(
''
);
const
formdata
=
reactive
<
{
orderNumber
:
string
;
evaluation
:
string
;
images
:
string
[];
isAnonymous
:
number
;
descriptionMatches
:
number
;
merchantServices
:
number
;
}
>
({
orderNumber
:
''
,
evaluation
:
''
,
images
:
[],
isAnonymous
:
0
,
descriptionMatches
:
0
,
merchantServices
:
0
,
});
const
action
=
ref
<
string
>
(
'/zhTuw2P8c29bc981a741931bdd86eb04dc1e8fd64865cb5/upload'
);
const
rules
=
{};
/**
* 显示推荐菜
*/
const
show
=
ref
<
boolean
>
(
false
);
/**
* 评分
*/
const
merchantServices
=
ref
<
number
>
(
0
);
const
merList
=
ref
({
1
:
'非常差'
,
2
:
'差'
,
3
:
'一般'
,
4
:
'好'
,
5
:
'非常好'
,
});
const
handlemerchant
=
(
e
)
=>
{
merchantServices
.
value
=
e
.
value
;
};
const
fileList
=
ref
([]);
/**
* 图片上传
*/
const
fileUPload
=
ref
<
string
>
(
'/'
);
function
handleChange
({
files
})
{
fileList
.
value
=
files
;
}
const
mode
=
reactive
<
{
switchVal
:
boolean
;
}
>
({
switchVal
:
true
,
});
function
handleFile
({
files
})
{}
const
handleSubmit
=
async
()
=>
{
const
res
=
await
evaluation
();
console
.
log
(
formdata
);
};
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
...
...
@@ -141,15 +197,32 @@ const mode = reactive<{
.tuijian
{
margin-top
:
72rpx
;
.tjTitle
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
40rpx
;
.textRight
{
font-size
:
24rpx
;
}
}
}
.itemSwichval
{
width
:
auto
;
padding
:
0
;
margin-top
:
72rpx
;
:deep
(
.wd-cell__wrapper
)
{
padding
:
0
;
align-items
:
center
;
}
}
}
.wd-cel
{
--wot-size-side-padding
:
0px
;
}
</
style
>
src/pages/ticket/ticket.vue
View file @
e9e29550
...
...
@@ -2,8 +2,12 @@
<view
class=
"container"
>
<Header
title=
"我的券"
></Header>
<view
class=
"tab"
>
<view
:class=
"currentTab == index ? 'tab-select' : 'tab-item'"
@
click=
"changeTab(index)"
v-for=
"(item, index) in tabList"
:key=
"index"
>
<view
:class=
"currentTab == index ? 'tab-select' : 'tab-item'"
@
click=
"changeTab(index)"
v-for=
"(item, index) in tabList"
:key=
"index"
>
{{
item
}}
</view>
</view>
...
...
@@ -15,8 +19,12 @@
<!-- 优惠券状态 -->
<view
class=
"status"
>
<view
:class=
"currenStatus == index ? 'status-select' : 'status-item'"
@
click=
"changeStatus(index)"
v-for=
"(item, index) in statusList"
:key=
"index"
>
<view
:class=
"currenStatus == index ? 'status-select' : 'status-item'"
@
click=
"changeStatus(index)"
v-for=
"(item, index) in statusList"
:key=
"index"
>
{{
item
}}
</view>
</view>
...
...
@@ -39,7 +47,11 @@
</view>
<view
class=
"ticket-right"
>
<image
class=
"img"
:src=
"iconUrl[item.status]"
v-if=
"item.status == 0 || item.status == 2"
></image>
<image
class=
"img"
:src=
"iconUrl[item.status]"
v-if=
"item.status == 0 || item.status == 2"
></image>
<view
class=
"head"
>
<text
class=
"title"
>
{{
item
.
couponName
}}
</text>
<view
class=
"headbox"
>
...
...
@@ -55,8 +67,11 @@
<view
class=
"line"
></view>
<view
class=
"footbox"
@
click=
"handleChangeDetail(index)"
>
<text
class=
"desc"
>
详细信息
</text>
<wd-icon
:name=
"item.showDetail ? 'chevron-down' : 'chevron-right'"
size=
"15px"
color=
"#9d9d9d"
></wd-icon>
<wd-icon
:name=
"item.showDetail ? 'chevron-down' : 'chevron-right'"
size=
"15px"
color=
"#9d9d9d"
></wd-icon>
</view>
</view>
</view>
...
...
src/utils/request.js
View file @
e9e29550
...
...
@@ -26,6 +26,7 @@ export const request = ({ url, data = {}, header, method = 'GET' }) => {
duration
:
1000
,
icon
:
'none'
,
});
return
;
}
resolve
(
res
.
data
);
},
...
...
yarn.lock
View file @
e9e29550
...
...
@@ -6013,7 +6013,7 @@ vary@~1.1.2:
vconsole@^3.15.1:
version "3.15.1"
resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz
#569a8ab15f353259527bbcf004f02946b4482cff
"
resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz"
integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==
dependencies:
"@babel/runtime" "^7.17.2"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment