Compare commits
173 Commits
fix/0521-c
...
main
Author | SHA1 | Date |
---|---|---|
|
550ea9ddf9 | 1 year ago |
|
a83f41c883 | 2 years ago |
|
0237f70511 | 2 years ago |
|
24df19af14 | 3 years ago |
|
fad9ff6ccb | 3 years ago |
|
f360233caa | 3 years ago |
|
0508a6d9df | 3 years ago |
|
041e15495d | 3 years ago |
|
2a42d55fb6 | 3 years ago |
|
d1f0e5fbd4 | 3 years ago |
|
874340f948 | 3 years ago |
|
39f379875b | 3 years ago |
|
5d8a42f48c | 3 years ago |
|
b59d0698ae | 3 years ago |
|
194587ba1b | 3 years ago |
|
9f195f09b7 | 3 years ago |
|
a35cb72501 | 3 years ago |
|
c010790f96 | 3 years ago |
|
f20ced40ad | 3 years ago |
|
03dab5bd96 | 3 years ago |
|
314f79f2ae | 3 years ago |
|
24ba55fa25 | 3 years ago |
|
7e7ab987b1 | 3 years ago |
|
5832a43169 | 3 years ago |
|
b3cd9615ca | 3 years ago |
|
fb70e2306f | 3 years ago |
|
0ce97eb86b | 3 years ago |
|
460ba55458 | 3 years ago |
|
325bee7e80 | 3 years ago |
|
ffc9769565 | 3 years ago |
|
0ce7d20886 | 3 years ago |
|
4011d2d49c | 3 years ago |
|
774b4f4064 | 3 years ago |
|
4880836a27 | 3 years ago |
|
251d091312 | 3 years ago |
|
987566558d | 3 years ago |
|
ffdb3e549f | 3 years ago |
|
e0b48c9ea6 | 3 years ago |
|
1e6de755bd | 3 years ago |
|
d4a93fed3d | 3 years ago |
|
b198706159 | 3 years ago |
|
6cc4720315 | 3 years ago |
|
71f9e086d7 | 3 years ago |
|
df1a27323d | 3 years ago |
|
4490d1af99 | 3 years ago |
|
f278d52028 | 3 years ago |
|
0391e24745 | 3 years ago |
|
3e9f8e617e | 3 years ago |
|
907bcabad2 | 3 years ago |
|
3739301d83 | 3 years ago |
|
5dc332c05f | 3 years ago |
|
3d61ca3c1e | 3 years ago |
|
410a721436 | 3 years ago |
|
588a41d196 | 3 years ago |
|
03e27975b4 | 3 years ago |
|
9722f26b90 | 3 years ago |
|
b2d1f2d9c0 | 3 years ago |
|
f6c4182e68 | 3 years ago |
|
efdf803082 | 3 years ago |
|
e5634eeacb | 3 years ago |
|
d1ba4b1842 | 3 years ago |
|
2b3e4a954b | 3 years ago |
|
46a6767afb | 3 years ago |
|
f11b0ee085 | 3 years ago |
|
96def57eaa | 3 years ago |
|
6b2adcaf6a | 3 years ago |
|
2f1332b05d | 3 years ago |
|
ec932a429b | 3 years ago |
|
5b6e2d46d2 | 3 years ago |
|
a27ce47f65 | 3 years ago |
|
6892041093 | 3 years ago |
|
a75e6b163c | 3 years ago |
|
98f910dbe9 | 3 years ago |
|
1d3fa277b2 | 3 years ago |
|
ac0fc976ed | 3 years ago |
|
4e65eeb11a | 3 years ago |
|
dd0b6345d5 | 3 years ago |
|
8f0bc44425 | 3 years ago |
|
5c62b79812 | 3 years ago |
|
925d13cc40 | 3 years ago |
|
90e514436b | 3 years ago |
|
8891cc6734 | 3 years ago |
|
e814e1aa0c | 3 years ago |
|
5aff24319d | 3 years ago |
|
47c4d8c11c | 3 years ago |
|
c2d0857ca1 | 3 years ago |
|
eacb092b13 | 3 years ago |
|
017b4da59a | 3 years ago |
|
c62a4ec0c9 | 3 years ago |
|
c9aa0198ff | 3 years ago |
|
bbfb4e3108 | 3 years ago |
|
f6fb143a69 | 3 years ago |
|
226109cdbf | 3 years ago |
|
0d24392296 | 3 years ago |
|
cdceda6747 | 3 years ago |
|
07f0f61983 | 3 years ago |
|
d694741ee1 | 3 years ago |
|
9067de54da | 3 years ago |
|
ae4a4284c9 | 3 years ago |
|
99f950804b | 3 years ago |
|
118282854d | 3 years ago |
|
e3fd51b216 | 3 years ago |
|
653bbf90f7 | 3 years ago |
|
ecd5c60430 | 3 years ago |
|
d5ec34c4da | 3 years ago |
|
71e6293742 | 3 years ago |
|
58657621d9 | 3 years ago |
|
a29f1065e4 | 3 years ago |
|
e7c43936f1 | 3 years ago |
|
5e79d78bfc | 3 years ago |
|
c474aa0d26 | 3 years ago |
|
4ca27cdf8a | 3 years ago |
|
daac64b0c9 | 3 years ago |
|
2df056765f | 3 years ago |
|
0df5bbcc18 | 3 years ago |
|
5d795b11b4 | 3 years ago |
|
536067e197 | 3 years ago |
|
51ee94d573 | 3 years ago |
|
0bdab1c4bf | 3 years ago |
|
e891706f3d | 3 years ago |
|
317cf6225d | 3 years ago |
|
f6bdf195c0 | 3 years ago |
|
02552acb69 | 3 years ago |
|
d6516bbfcf | 3 years ago |
|
7e4dd1b9ca | 3 years ago |
|
34852eeec8 | 3 years ago |
|
debe46ebfb | 3 years ago |
|
75b09e3653 | 3 years ago |
|
048171750a | 3 years ago |
|
f29f120e0c | 3 years ago |
|
9bd1c4ba50 | 3 years ago |
|
73f29f9490 | 3 years ago |
|
46aa9ad5e7 | 3 years ago |
|
9ec2ca4f1b | 3 years ago |
|
502f445666 | 3 years ago |
|
5575d46da0 | 3 years ago |
|
b0f9249b5b | 3 years ago |
|
d586378092 | 3 years ago |
|
5a2d4195b6 | 3 years ago |
|
99e2219f92 | 3 years ago |
|
3dc6c233af | 3 years ago |
|
02127626e3 | 3 years ago |
|
c4b9f8a4a2 | 3 years ago |
|
b82d29807f | 3 years ago |
|
b2f9127904 | 3 years ago |
|
ea1b0e80cc | 3 years ago |
|
a40aa558e1 | 3 years ago |
|
693cc0417a | 3 years ago |
|
7df16f45ca | 3 years ago |
|
2734b3c272 | 3 years ago |
|
1173416e6c | 3 years ago |
|
742b847a45 | 3 years ago |
|
5100284312 | 3 years ago |
|
29b6ff483c | 3 years ago |
|
7477feaf3b | 3 years ago |
|
abe6b4f405 | 3 years ago |
|
567ee059a1 | 3 years ago |
|
3f3b164c64 | 3 years ago |
|
86f6c2afeb | 3 years ago |
|
5fec7cde3b | 3 years ago |
|
8164a9cd76 | 3 years ago |
|
07d765b228 | 3 years ago |
|
462a98ed19 | 3 years ago |
|
bf72b62c13 | 3 years ago |
|
bd2ccede25 | 3 years ago |
|
f5a52891a9 | 3 years ago |
|
ae7a2e8400 | 3 years ago |
|
9750bd2740 | 3 years ago |
|
188e746404 | 3 years ago |
|
598ab73781 | 3 years ago |
|
649b91d8a1 | 3 years ago |
|
990cd56690 | 3 years ago |
|
0cf30a999f | 3 years ago |
@ -0,0 +1,3 @@
|
|||||||
|
VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.cn
|
||||||
|
VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.cn
|
||||||
|
VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn
|
@ -0,0 +1,3 @@
|
|||||||
|
VUE_APP_BASE_URL = https://you-gateway.mashibing.com
|
||||||
|
VUE_APP_STATIC_URL = https://you-app.mashibing.com
|
||||||
|
VUE_APP_IM_URL = wss://you-gateway.mashibing.com
|
@ -0,0 +1,3 @@
|
|||||||
|
VUE_APP_BASE_URL = https://you-gateway.mashibing.com
|
||||||
|
VUE_APP_STATIC_URL = https://you-app.mashibing.com
|
||||||
|
VUE_APP_IM_URL = wss://you-gateway.mashibing.com
|
@ -0,0 +1,3 @@
|
|||||||
|
VUE_APP_BASE_URL = https://k8s-horse-gateway.mashibing.com
|
||||||
|
VUE_APP_STATIC_URL = https://k8s-shop-app.mashibing.com
|
||||||
|
VUE_APP_IM_URL = wss://k8s-horse-gateway.mashibing.cn
|
@ -1,8 +1,28 @@
|
|||||||
.hbuilderx/
|
|
||||||
|
.DS_Store
|
||||||
|
node_modules/
|
||||||
|
unpackage/
|
||||||
|
dist/
|
||||||
.history/
|
.history/
|
||||||
|
.hbuilderx/
|
||||||
env.js
|
env.js
|
||||||
node_moudel/
|
yarn.lock
|
||||||
package-lock.json
|
|
||||||
unpackage/dist/build/.automator/
|
# local env files
|
||||||
unpackage/dist/dev
|
.env.local
|
||||||
unpackage/cache
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.project
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM nginx
|
FROM nginx
|
||||||
COPY unpackage/dist/build/h5 /usr/share/nginx/html
|
COPY dist/build/h5 /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
const plugins = []
|
||||||
|
|
||||||
|
if (process.env.UNI_OPT_TREESHAKINGNG) {
|
||||||
|
plugins.push(require('@dcloudio/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(
|
||||||
|
process.env.UNI_PLATFORM === 'app-plus' &&
|
||||||
|
process.env.UNI_USING_V8
|
||||||
|
) ||
|
||||||
|
(
|
||||||
|
process.env.UNI_PLATFORM === 'h5' &&
|
||||||
|
process.env.UNI_H5_BROWSER === 'builtin'
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const isWin = /^win/.test(process.platform)
|
||||||
|
|
||||||
|
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
|
||||||
|
|
||||||
|
const input = normalizePath(process.env.UNI_INPUT_DIR)
|
||||||
|
try {
|
||||||
|
plugins.push([
|
||||||
|
require('@dcloudio/vue-cli-plugin-hbuilderx/packages/babel-plugin-console'),
|
||||||
|
{
|
||||||
|
file (file) {
|
||||||
|
file = normalizePath(file)
|
||||||
|
if (file.indexOf(input) === 0) {
|
||||||
|
return path.relative(input, file)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
|
||||||
|
process.UNI_LIBRARIES.forEach(libraryName => {
|
||||||
|
plugins.push([
|
||||||
|
'import',
|
||||||
|
{
|
||||||
|
'libraryName': libraryName,
|
||||||
|
'customName': (name) => {
|
||||||
|
return `${libraryName}/lib/${name}/${name}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@vue/app',
|
||||||
|
{
|
||||||
|
modules: 'commonjs',
|
||||||
|
useBuiltIns: process.env.UNI_PLATFORM === 'h5' ? 'usage' : 'entry'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
plugins
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-03-22 18:28:52
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-04-29 14:13:05
|
|
||||||
* @Description: file content
|
|
||||||
*/
|
|
||||||
import Vue from 'vue'
|
|
||||||
import Vuex from 'vuex';
|
|
||||||
|
|
||||||
Vue.use(Vuex);
|
|
||||||
const
|
|
||||||
// token
|
|
||||||
TOKEN = 'tk',
|
|
||||||
// 用户信息
|
|
||||||
USER_INFO = 'ui',
|
|
||||||
// 地址列表
|
|
||||||
ADDRESS = 'ads',
|
|
||||||
// oppenId
|
|
||||||
OPPED_ID = 'oi';
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
|
||||||
state : {
|
|
||||||
token : uni.getStorageSync(TOKEN) || '',
|
|
||||||
userInfo : JSON.parse(uni.getStorageSync(USER_INFO) || '{}'),
|
|
||||||
address : JSON.parse(uni.getStorageSync(ADDRESS) || '[]'),
|
|
||||||
sessionData : [],
|
|
||||||
sessionMsgCount : 0,
|
|
||||||
sessionMsgId : '',
|
|
||||||
openId : uni.getStorageSync(OPPED_ID) || ''
|
|
||||||
},
|
|
||||||
mutations:{
|
|
||||||
SET_TOKEN (state, token = ''){
|
|
||||||
state.token = token;
|
|
||||||
uni.setStorageSync(TOKEN, token);
|
|
||||||
},
|
|
||||||
SET_USER_INFO (state, userInfo = {}){
|
|
||||||
state.userInfo = userInfo;
|
|
||||||
uni.setStorageSync(USER_INFO, JSON.stringify(userInfo));
|
|
||||||
},
|
|
||||||
SET_ADDRESS (state, address = []){
|
|
||||||
state.address = address;
|
|
||||||
uni.setStorageSync(ADDRESS, JSON.stringify(address));
|
|
||||||
},
|
|
||||||
SET_SESSION_DATA (state, data){
|
|
||||||
state.sessionData = data ;
|
|
||||||
},
|
|
||||||
SET_SESSION_MSG_COUNT (state, data){
|
|
||||||
state.sessionMsgCount = data;
|
|
||||||
},
|
|
||||||
SET_OPEN_ID (state, data){
|
|
||||||
state.openId = data;
|
|
||||||
uni.setStorageSync(OPPED_ID, data);
|
|
||||||
},
|
|
||||||
SET_SESSION_MSG_ID (state, data){
|
|
||||||
state.sessionMsgId = data;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions : {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-03-22 16:52:28
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-05-06 21:06:14
|
|
||||||
* @Description: 所有工具类统一在这输出
|
|
||||||
*/
|
|
||||||
import * as util from './utils';
|
|
||||||
import * as requset from './requset';
|
|
||||||
import * as websocket from './requset';
|
|
||||||
import * as wxpay from './wxpay';
|
|
||||||
|
|
||||||
export * from './utils';
|
|
||||||
export * from './requset';
|
|
||||||
export * from './websocket';
|
|
||||||
export * from './wxpay';
|
|
||||||
|
|
||||||
export default { ...util, ...requset, ...websocket, ...wxpay}
|
|
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-04-19 16:14:03
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-04-19 17:20:08
|
|
||||||
* @Description: file content
|
|
||||||
*/
|
|
||||||
import Confirm from '../UiConfirm.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
install (Vue) {
|
|
||||||
// 创建构造类
|
|
||||||
const ConfirmConstructor = Vue.extend(Confirm)
|
|
||||||
|
|
||||||
const showNextConfirm = function (options) {
|
|
||||||
// 实例化组件
|
|
||||||
const instance = new ConfirmConstructor({
|
|
||||||
el: document.createElement('div')
|
|
||||||
})
|
|
||||||
// 处理参数
|
|
||||||
for (const prop in options) {
|
|
||||||
instance[prop] = options[prop];
|
|
||||||
}
|
|
||||||
// 插入Body
|
|
||||||
document.body.appendChild(instance.$el)
|
|
||||||
Vue.nextTick(() => {
|
|
||||||
instance.show = true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmFn = (options) => {
|
|
||||||
return showNextConfirm(options);
|
|
||||||
}
|
|
||||||
Vue.prototype.$msb ?
|
|
||||||
Vue.prototype.$msb.confirm = confirmFn :
|
|
||||||
Vue.prototype.$msb={confirm : confirmFn }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-05-05 10:57:05
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-05-05 16:53:23
|
|
||||||
* @Description: file content
|
|
||||||
-->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<script>
|
|
||||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
||||||
CSS.supports('top: constant(a)'))
|
|
||||||
document.write(
|
|
||||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
||||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
||||||
</script>
|
|
||||||
<title></title>
|
|
||||||
<!--preload-links-->
|
|
||||||
<!--app-context-->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"><!--app-html--></div>
|
|
||||||
<script type="module" src="/main.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,123 @@
|
|||||||
{
|
{
|
||||||
"name": "shopping-app",
|
"name": "shop-app",
|
||||||
"version": "1.0.0",
|
"version": "0.1.0",
|
||||||
"description": "严选",
|
"private": true,
|
||||||
"main": "main.js",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"server": "npm run dev:h5",
|
||||||
|
"server:test": "npm run dev:h5-test",
|
||||||
|
"server:bate": "npm run dev:h5-bate",
|
||||||
|
"server:prod": "npm run dev:h5-prod",
|
||||||
|
"build:test": "npm run build:h5-test",
|
||||||
|
"build:bate": "npm run build:h5-bate",
|
||||||
|
"build:prod": "npm run build:h5-prod",
|
||||||
|
"build:app-plus": "cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build",
|
||||||
|
"build:custom": "cross-env NODE_ENV=production uniapp-cli custom",
|
||||||
|
"build:h5-test": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode test",
|
||||||
|
"build:h5-bate": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode bate",
|
||||||
|
"build:h5-prod": "cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build --mode prod",
|
||||||
|
"build:mp-360": "cross-env NODE_ENV=production UNI_PLATFORM=mp-360 vue-cli-service uni-build",
|
||||||
|
"build:mp-alipay": "cross-env NODE_ENV=production UNI_PLATFORM=mp-alipay vue-cli-service uni-build",
|
||||||
|
"build:mp-baidu": "cross-env NODE_ENV=production UNI_PLATFORM=mp-baidu vue-cli-service uni-build",
|
||||||
|
"build:mp-jd": "cross-env NODE_ENV=production UNI_PLATFORM=mp-jd vue-cli-service uni-build",
|
||||||
|
"build:mp-kuaishou": "cross-env NODE_ENV=production UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build",
|
||||||
|
"build:mp-lark": "cross-env NODE_ENV=production UNI_PLATFORM=mp-lark vue-cli-service uni-build",
|
||||||
|
"build:mp-qq": "cross-env NODE_ENV=production UNI_PLATFORM=mp-qq vue-cli-service uni-build",
|
||||||
|
"build:mp-toutiao": "cross-env NODE_ENV=production UNI_PLATFORM=mp-toutiao vue-cli-service uni-build",
|
||||||
|
"build:mp-weixin": "cross-env NODE_ENV=production UNI_PLATFORM=mp-weixin vue-cli-service uni-build",
|
||||||
|
"build:mp-xhs": "cross-env NODE_ENV=production UNI_PLATFORM=mp-xhs vue-cli-service uni-build",
|
||||||
|
"build:quickapp-native": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-native vue-cli-service uni-build",
|
||||||
|
"build:quickapp-webview": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview vue-cli-service uni-build",
|
||||||
|
"build:quickapp-webview-huawei": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build",
|
||||||
|
"build:quickapp-webview-union": "cross-env NODE_ENV=production UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build",
|
||||||
|
"dev:app-plus": "cross-env NODE_ENV=development UNI_PLATFORM=app-plus vue-cli-service uni-build --watch",
|
||||||
|
"dev:custom": "cross-env NODE_ENV=development uniapp-cli custom",
|
||||||
|
"dev:h5": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve",
|
||||||
|
"dev:h5-test": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode test",
|
||||||
|
"dev:h5-bate": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode bate",
|
||||||
|
"dev:h5-prod": "cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve --mode prod",
|
||||||
|
"dev:mp-360": "cross-env NODE_ENV=development UNI_PLATFORM=mp-360 vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-alipay": "cross-env NODE_ENV=development UNI_PLATFORM=mp-alipay vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-baidu": "cross-env NODE_ENV=development UNI_PLATFORM=mp-baidu vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-jd": "cross-env NODE_ENV=development UNI_PLATFORM=mp-jd vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-kuaishou": "cross-env NODE_ENV=development UNI_PLATFORM=mp-kuaishou vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-lark": "cross-env NODE_ENV=development UNI_PLATFORM=mp-lark vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-qq": "cross-env NODE_ENV=development UNI_PLATFORM=mp-qq vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-toutiao": "cross-env NODE_ENV=development UNI_PLATFORM=mp-toutiao vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch",
|
||||||
|
"dev:mp-xhs": "cross-env NODE_ENV=development UNI_PLATFORM=mp-xhs vue-cli-service uni-build --watch",
|
||||||
|
"dev:quickapp-native": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-native vue-cli-service uni-build --watch",
|
||||||
|
"dev:quickapp-webview": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview vue-cli-service uni-build --watch",
|
||||||
|
"dev:quickapp-webview-huawei": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-huawei vue-cli-service uni-build --watch",
|
||||||
|
"dev:quickapp-webview-union": "cross-env NODE_ENV=development UNI_PLATFORM=quickapp-webview-union vue-cli-service uni-build --watch",
|
||||||
|
"info": "node node_modules/@dcloudio/vue-cli-plugin-uni/commands/info.js",
|
||||||
|
"serve:quickapp-native": "node node_modules/@dcloudio/uni-quickapp-native/bin/serve.js",
|
||||||
|
"test:android": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=android jest -i",
|
||||||
|
"test:h5": "cross-env UNI_PLATFORM=h5 jest -i",
|
||||||
|
"test:ios": "cross-env UNI_PLATFORM=app-plus UNI_OS_NAME=ios jest -i",
|
||||||
|
"test:mp-baidu": "cross-env UNI_PLATFORM=mp-baidu jest -i",
|
||||||
|
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
|
||||||
},
|
},
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "http://internel-git.mashibing.cn/chenhui/shopping-app.git"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dcloudio/uni-app-plus": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-h5": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-helper-json": "*",
|
||||||
|
"@dcloudio/uni-i18n": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-360": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-alipay": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-baidu": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-jd": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-kuaishou": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-lark": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-qq": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-toutiao": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-vue": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-weixin": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-mp-xhs": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-quickapp-native": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-quickapp-webview": "^2.0.1-34720220422002",
|
||||||
|
"@dcloudio/uni-stat": "^2.0.1-34720220422002",
|
||||||
|
"@vue/shared": "^3.0.0",
|
||||||
|
"caniuse-lite": "^1.0.30001640",
|
||||||
|
"core-js": "^3.6.5",
|
||||||
|
"flyio": "^0.6.2",
|
||||||
|
"js-util-all": "^1.0.6",
|
||||||
"mp-html": "^2.2.2",
|
"mp-html": "^2.2.2",
|
||||||
|
"regenerator-runtime": "^0.12.1",
|
||||||
"uni-read-pages": "^1.0.5",
|
"uni-read-pages": "^1.0.5",
|
||||||
"uni-simple-router": "^2.0.7",
|
"uni-simple-router": "^2.0.7",
|
||||||
"uview-ui": "^2.0.29",
|
"uview-ui": "^2.0.29",
|
||||||
"vuex": "^3.6.2"
|
"vue": "^2.6.11",
|
||||||
|
"vuex": "^3.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@dcloudio/uni-helper-json": "^1.0.13",
|
"@babel/runtime": "~7.12.0",
|
||||||
"git-repo-info": "^2.1.1"
|
"@dcloudio/types": "^2.6.7",
|
||||||
|
"@dcloudio/uni-automator": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/uni-cli-i18n": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/uni-cli-shared": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/uni-migration": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/uni-template-compiler": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/vue-cli-plugin-uni": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/webpack-uni-mp-loader": "2.0.2-4010520240507001",
|
||||||
|
"@dcloudio/webpack-uni-pages-loader": "2.0.2-4010520240507001",
|
||||||
|
"@vue/cli-plugin-babel": "~4.5.15",
|
||||||
|
"@vue/cli-service": "~4.5.15",
|
||||||
|
"babel-plugin-import": "1.13.8",
|
||||||
|
"cross-env": "7.0.3",
|
||||||
|
"jest": "25.5.4",
|
||||||
|
"mini-types": "*",
|
||||||
|
"miniprogram-api-typings": "*",
|
||||||
|
"postcss-comment": "^2.0.0",
|
||||||
|
"sass": "^1.52.1",
|
||||||
|
"vue-template-compiler": "^2.6.11"
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"Android >= 4.4",
|
||||||
|
"ios >= 9"
|
||||||
|
],
|
||||||
|
"uni-app": {
|
||||||
|
"scripts": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,127 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-03-26 14:32:03
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-05-17 16:22:13
|
|
||||||
* @Description: file content
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<view class="main">
|
|
||||||
<view class="msg-item" v-for="item in msgData" :key="item.id">
|
|
||||||
<view class="msg-item--title">
|
|
||||||
<text>{{item.payload.title }} {{item.id}}</text>
|
|
||||||
<text class="msg-item--time">{{item.createTimeStamp}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="msg-item--con">
|
|
||||||
<image class="msg-item--img" src="@/static/message/xt.png" mode="widthFix"/>
|
|
||||||
<view class="msg-item--desc">{{item.payload.content}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<u-loadmore status="loading" v-if="!msgData.length"/>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {MsbWebSkt, createUUID} from '@/common/utils';
|
|
||||||
export default {
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
curSessionData(){
|
|
||||||
return this.$store.state.sessionData.find(i =>i.id == this.$store.state.sessionMsgId)
|
|
||||||
},
|
|
||||||
msgData (){
|
|
||||||
return this.curSessionData ? this.curSessionData.messageList : [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onReachBottom(){
|
|
||||||
this.getHistoryMsg();
|
|
||||||
},
|
|
||||||
onShow(){
|
|
||||||
if(!this.$store.state.sessionMsgId){
|
|
||||||
this.$Router.back();
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title : this.curSessionData.fromNickname
|
|
||||||
});
|
|
||||||
|
|
||||||
this.getHistoryMsg();
|
|
||||||
this.readMsg();
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
/**
|
|
||||||
* 获取历史消息
|
|
||||||
*/
|
|
||||||
getHistoryMsg(){
|
|
||||||
this.loading = true;
|
|
||||||
const lastMsg = this.msgData[this.msgData.length - 1] || {};
|
|
||||||
MsbWebSkt.send({
|
|
||||||
data : JSON.stringify({
|
|
||||||
traceId : createUUID(),
|
|
||||||
traceType : "2",
|
|
||||||
content: {
|
|
||||||
sessionId : this.$store.state.sessionMsgId,
|
|
||||||
topMessageId : lastMsg.id || null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 已读消息
|
|
||||||
*/
|
|
||||||
readMsg(){
|
|
||||||
MsbWebSkt.send({
|
|
||||||
data : JSON.stringify({
|
|
||||||
traceId : createUUID(),
|
|
||||||
traceType : "6",
|
|
||||||
content: {
|
|
||||||
sessionId : this.$store.state.sessionMsgId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
// 计算页头消息数
|
|
||||||
const count = this.$store.state.sessionMsgCount - this.curSessionData.unreadCount;
|
|
||||||
// 计算会话列表消息数
|
|
||||||
this.curSessionData.unreadCount = 0;
|
|
||||||
this.$store.commit('SET_SESSION_MSG_COUNT', count)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.msg-item{
|
|
||||||
padding: 40rpx 0 0 40rpx;
|
|
||||||
&--title{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding-right: 40rpx;
|
|
||||||
font-size: $font-size-lg;
|
|
||||||
color: $color-grey6;
|
|
||||||
}
|
|
||||||
&--time{
|
|
||||||
font-size: $font-size-sm;
|
|
||||||
color: $color-grey4;
|
|
||||||
}
|
|
||||||
&--con{
|
|
||||||
display: flex;
|
|
||||||
border-bottom: 1px solid $color-grey2;
|
|
||||||
padding: 40rpx 0;
|
|
||||||
}
|
|
||||||
&--img{
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
margin-right: 40rpx;
|
|
||||||
}
|
|
||||||
&--desc{
|
|
||||||
width: 455rpx;
|
|
||||||
font-size: $font-size-base;
|
|
||||||
line-height: 39rpx;
|
|
||||||
color: $color-grey5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -0,0 +1,22 @@
|
|||||||
|
const path = require('path')
|
||||||
|
module.exports = {
|
||||||
|
parser: require('postcss-comment'),
|
||||||
|
plugins: [
|
||||||
|
require('postcss-import')({
|
||||||
|
resolve (id, basedir, importOptions) {
|
||||||
|
if (id.startsWith('~@/')) {
|
||||||
|
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3))
|
||||||
|
} else if (id.startsWith('@/')) {
|
||||||
|
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2))
|
||||||
|
} else if (id.startsWith('/') && !id.startsWith('//')) {
|
||||||
|
return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1))
|
||||||
|
}
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
require('autoprefixer')({
|
||||||
|
remove: process.env.UNI_PLATFORM !== 'h5'
|
||||||
|
}),
|
||||||
|
require('@dcloudio/vue-cli-plugin-uni/packages/postcss')
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-27 17:44:36
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-29 21:37:10
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>
|
||||||
|
<%= htmlWebpackPlugin.options.title %>
|
||||||
|
</title>
|
||||||
|
<script>
|
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||||
|
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||||
|
</script>
|
||||||
|
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="page">
|
||||||
|
<noscript>
|
||||||
|
<strong>Please enable JavaScript to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-31 11:17:38
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-05-31 11:35:10
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {ToAsyncAwait, MsbRequest} from '@/common/utils';
|
||||||
|
import { AD_PLATFORM } from '../dicts/ad';
|
||||||
|
|
||||||
|
const BASE_URL = '/mall/marketing';
|
||||||
|
|
||||||
|
// 获取广告列表
|
||||||
|
export const ApiGetAdList = (params) => ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/advertisement`, {
|
||||||
|
platform : AD_PLATFORM.MOBILE,
|
||||||
|
...params
|
||||||
|
}))
|
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-20 11:38:48
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-30 11:53:57
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils';
|
||||||
|
|
||||||
|
const BASE_URL = '/mall/comment';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据商品获取评论列表
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiGetCommentList = (params) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment`,params, {
|
||||||
|
notVerifyToken: true
|
||||||
|
}));
|
||||||
|
/**
|
||||||
|
* 根据商品获取评论总数
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiGetCommentCount = ({productId}) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/getAllCommentCountByProductId/${productId}`,{}, {
|
||||||
|
notVerifyToken: true
|
||||||
|
}));
|
||||||
|
/**
|
||||||
|
* 根据商品获取标签评论总数
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiGetCommentTabCount = ({productId}) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/listCommentLabel/${productId}`,{}, {
|
||||||
|
notVerifyToken: true
|
||||||
|
}));
|
||||||
|
/**
|
||||||
|
* 获取订单评论详情
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiGetOrderCommentDetail = ({orderId}) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/listOrderCommentByOrderId/${orderId}`));
|
||||||
|
/**
|
||||||
|
* 获取评论详情
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiGetCommentDetail = ({commentId}) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/comment/getCommentDetail/${commentId}`,{}, {
|
||||||
|
notVerifyToken: true
|
||||||
|
}));
|
||||||
|
/**
|
||||||
|
* 新增评论
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiPostComment = (data) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/app/comment`, data));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新评论有用数
|
||||||
|
* @param {*} param0
|
||||||
|
*/
|
||||||
|
export const ApiPutCommentUseful = (data) =>
|
||||||
|
ToAsyncAwait(MsbRequestTk.put(`${BASE_URL}/app/comment/updateUsefulCount`,data));
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-27 17:44:36
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-09 11:34:36
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
import {ToAsyncAwait, MsbRequestTk} from '@/common/utils';
|
||||||
|
const BASE_URL = '/mall/im';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取soket登录秘钥
|
||||||
|
*/
|
||||||
|
export const ApiGetSoketTicket = () => ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/ticket`, {
|
||||||
|
ticketType: 'CONNECT_TICKET'
|
||||||
|
}));
|
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-31 11:05:08
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-05-31 17:23:02
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
const AD_PLATFORM = {
|
||||||
|
PC: 2,
|
||||||
|
MOBILE : 1
|
||||||
|
}
|
||||||
|
const AD_LOCATION = {
|
||||||
|
// 首页轮播图
|
||||||
|
HOME_BANNER: 1,
|
||||||
|
// 首页精装区
|
||||||
|
HOME_HARDCOVER: 2,
|
||||||
|
// 分类banner
|
||||||
|
CATEGORY_BANNER : 3
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const AD_JUMP_TYPE = {
|
||||||
|
// 商品详情
|
||||||
|
GOODS: 1,
|
||||||
|
// 分类
|
||||||
|
CATEGORY: 2,
|
||||||
|
// 链接
|
||||||
|
LINK: 3,
|
||||||
|
// 不跳转
|
||||||
|
NO_JUMP : 4
|
||||||
|
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
// 广告所属平台
|
||||||
|
AD_PLATFORM,
|
||||||
|
// 广告位置
|
||||||
|
AD_LOCATION,
|
||||||
|
// 广告跳转类型
|
||||||
|
AD_JUMP_TYPE
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-20 11:10:23
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-28 16:33:25
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
TYPE : {
|
||||||
|
// 评价
|
||||||
|
COMMENT: 1,
|
||||||
|
// 追评
|
||||||
|
FOLLOW_COMMENT: 2,
|
||||||
|
// 回复
|
||||||
|
ANSWER: 3,
|
||||||
|
},
|
||||||
|
// 是否显示
|
||||||
|
DISPLAY: {
|
||||||
|
SHOW: 1,
|
||||||
|
HIDE : 0
|
||||||
|
},
|
||||||
|
// 用户类型
|
||||||
|
USER_TYPE: {
|
||||||
|
STORE : 1,
|
||||||
|
USER : 2
|
||||||
|
},
|
||||||
|
// 是否默认评价
|
||||||
|
IS_DEFAULT_COMMENT: {
|
||||||
|
YES: 1,
|
||||||
|
NOT : 0
|
||||||
|
},
|
||||||
|
RATE_LABEL : ['非常不满意','不满意','一般','满意','非常满意']
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-26 15:39:52
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-05-26 15:47:28
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 商品类型
|
||||||
|
const GOODS_TYPE = {
|
||||||
|
// 虚拟
|
||||||
|
VIRTUAL: 2,
|
||||||
|
// 实物
|
||||||
|
ENTITY : 1
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
GOODS_TYPE
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-03-22 18:28:52
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-22 15:31:09
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
import Vue from 'vue'
|
||||||
|
import Vuex from 'vuex';
|
||||||
|
|
||||||
|
Vue.use(Vuex);
|
||||||
|
const
|
||||||
|
// token
|
||||||
|
TOKEN = 'tk',
|
||||||
|
// 用户信息
|
||||||
|
USER_INFO = 'ui',
|
||||||
|
// 地址列表
|
||||||
|
ADDRESS = 'ads',
|
||||||
|
// oppenId
|
||||||
|
OPPED_ID = 'oi',
|
||||||
|
// 每个浏览器创建一个UUID作为同一个用户的标识
|
||||||
|
UUID = 'uid',
|
||||||
|
// 评价图片预览数据
|
||||||
|
COMMENT_PREVIEW = 'comment_preview';
|
||||||
|
|
||||||
|
export default new Vuex.Store({
|
||||||
|
state: {
|
||||||
|
token: uni.getStorageSync(TOKEN) || '',
|
||||||
|
userInfo: JSON.parse(uni.getStorageSync(USER_INFO) || '{}'),
|
||||||
|
address: JSON.parse(uni.getStorageSync(ADDRESS) || '[]'),
|
||||||
|
openId: uni.getStorageSync(OPPED_ID) || '',
|
||||||
|
uuid: uni.getStorageSync(UUID) || '',
|
||||||
|
comment_preview: JSON.parse(uni.getStorageSync(COMMENT_PREVIEW) || '{}'),
|
||||||
|
imData : [],
|
||||||
|
imMsgCount : 0
|
||||||
|
},
|
||||||
|
mutations:{
|
||||||
|
SET_TOKEN (state, token = ''){
|
||||||
|
state.token = token;
|
||||||
|
uni.setStorageSync(TOKEN, token);
|
||||||
|
},
|
||||||
|
SET_USER_INFO (state, userInfo = {}){
|
||||||
|
state.userInfo = userInfo;
|
||||||
|
uni.setStorageSync(USER_INFO, JSON.stringify(userInfo));
|
||||||
|
},
|
||||||
|
SET_ADDRESS (state, address = []){
|
||||||
|
state.address = address;
|
||||||
|
uni.setStorageSync(ADDRESS, JSON.stringify(address));
|
||||||
|
},
|
||||||
|
SET_UUID (state, uid){
|
||||||
|
state.uuid = uid;
|
||||||
|
uni.setStorageSync(UUID, uid);
|
||||||
|
},
|
||||||
|
SET_OPEN_ID (state, data){
|
||||||
|
state.openId = data;
|
||||||
|
uni.setStorageSync(OPPED_ID, data);
|
||||||
|
},
|
||||||
|
SET_COMMENT_PREVIEW(state, data) {
|
||||||
|
state.comment_preview = data;
|
||||||
|
uni.setStorageSync(COMMENT_PREVIEW, JSON.stringify(data));
|
||||||
|
},
|
||||||
|
SET_IM_DATA (state, data){
|
||||||
|
state.imData = data ;
|
||||||
|
},
|
||||||
|
SET_IM_MSG_COUNT (state, data){
|
||||||
|
state.imMsgCount = data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
actions : {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-04-29 14:26:10
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-07-13 10:37:21
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { ApiPostAliH5Pay, ApiPostAliAppPay } from '@/common/api/pay';
|
||||||
|
const ENV = process.env;
|
||||||
|
export const Alipay = async ({orderId})=>{
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
const {error, result} = await ApiPostAliAppPay({orderId});
|
||||||
|
if(error){
|
||||||
|
uni.$u.toast(error.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const par = result.payDataInfo;
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'alipay',
|
||||||
|
orderInfo :par.payData,
|
||||||
|
success(res) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url : `/payResult?orderId=${orderId}&payType=appWx`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url : `/payResult?orderId=${orderId}&payType=appWx`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
console.log('res',res);
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
const { error, result } = await ApiPostAliH5Pay({
|
||||||
|
orderId,
|
||||||
|
returnUrl : decodeURIComponent(`${ENV.VUE_APP_STATIC_URL}/payResult?orderId=${orderId}&payType=alih5`)
|
||||||
|
});
|
||||||
|
if(error){
|
||||||
|
uni.$u.toast(error.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
window.location.href = result.payDataInfo.payUrl;
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-20 11:00:07
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-07-13 10:37:52
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
|
||||||
|
import MsbIm from '@/common/plugins/msbIm' ;
|
||||||
|
import { ToAsyncAwait, FormatJsonSearch } from '@/common/utils';
|
||||||
|
import { ApiGetCurrentUser } from '@/common/api/account';
|
||||||
|
import { ApiGetSoketTicket } from '@/common/api/im';
|
||||||
|
import $store from '@/common/store';
|
||||||
|
const ENV = process.env;
|
||||||
|
|
||||||
|
const Im = new MsbIm({
|
||||||
|
reconnect: true,
|
||||||
|
});
|
||||||
|
const ImInit = async () => {
|
||||||
|
const { error, result } = await ApiGetSoketTicket();
|
||||||
|
if (error) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const par = FormatJsonSearch({
|
||||||
|
client: result.client,
|
||||||
|
ticket: result.ticket,
|
||||||
|
// 1普通用户 2客服链接
|
||||||
|
connect: 1,
|
||||||
|
user: $store.state.userInfo.id,
|
||||||
|
nickname: $store.state.userInfo.nickname,
|
||||||
|
avatar : $store.state.userInfo.avatar
|
||||||
|
})
|
||||||
|
await ToAsyncAwait(Im.init({
|
||||||
|
url: `${ENV.VUE_APP_IM_URL}/ws${par}`
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
|
||||||
|
Im.interceptors.dataChangeAfter = () => {
|
||||||
|
$store.commit('SET_IM_DATA', Im.sessionData);
|
||||||
|
let msgCount = 0;
|
||||||
|
Im.sessionData.forEach(i => {
|
||||||
|
msgCount += i.unreadCount;
|
||||||
|
})
|
||||||
|
$store.commit('SET_IM_MSG_COUNT', msgCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
Im.interceptors.onClose = () => {
|
||||||
|
Im.setSessionData([]);
|
||||||
|
Im.setCurSessionId(null);
|
||||||
|
$store.commit('SET_IM_DATA', []);
|
||||||
|
$store.commit('SET_IM_MSG_COUNT', 0);
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
Im,
|
||||||
|
ImInit
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-03-22 16:52:28
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-29 17:28:39
|
||||||
|
* @LastEditTime: 2022-06-29 17:22:32
|
||||||
|
* @Description: 所有工具类统一在这输出
|
||||||
|
*/
|
||||||
|
import * as util from './utils';
|
||||||
|
import * as requset from './requset';
|
||||||
|
import * as im from './im';
|
||||||
|
import * as wxpay from './wxpay';
|
||||||
|
import * as uploadFileOss from './uploadFileOss';
|
||||||
|
import * as alipay from './alipay';
|
||||||
|
|
||||||
|
export * from './utils';
|
||||||
|
export * from './requset';
|
||||||
|
export * from './im';
|
||||||
|
export * from './wxpay';
|
||||||
|
export * from './uploadFileOss';
|
||||||
|
export * from './alipay';
|
||||||
|
|
||||||
|
export default { ...util, ...requset, ...im, ...wxpay, ...uploadFileOss, ...alipay}
|
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-05-06 15:33:55
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-07-13 10:38:34
|
||||||
|
* @Description: file content
|
||||||
|
*/
|
||||||
|
import { Wxpay } from './wxpay';
|
||||||
|
export const pay = ({orderId, openId, payType})=>{
|
||||||
|
if(payType === 'wxpay'){
|
||||||
|
Wxpay({orderId, openId});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-23 10:40:04
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-30 18:01:46
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="follow">
|
||||||
|
<view class="follow--title">{{day}}追评:</view>
|
||||||
|
<view class="follow--ctx">{{followComment.commentContent}}</view>
|
||||||
|
<view class="follow--img" v-if="imgs.length">
|
||||||
|
<image class="follow--img-item" v-for="(item, idx) in imgs" :src="item" :key="idx" @click="preview(idx)" mode="aspectFit"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
commentDetail : {
|
||||||
|
type : Object,
|
||||||
|
default : () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
followComment(){
|
||||||
|
return this.commentDetail.followComment || {}
|
||||||
|
},
|
||||||
|
day(){
|
||||||
|
const followTime = (new Date(this.followComment.createTime)).getTime();
|
||||||
|
const commentTime = (new Date(this.commentDetail.createTime)).getTime();
|
||||||
|
const day = Math.floor((followTime - commentTime) / (24 * 60 * 60 * 1000));
|
||||||
|
return day > 0 ? `${day}天后` : `当天`;
|
||||||
|
},
|
||||||
|
|
||||||
|
imgs (){
|
||||||
|
let urls = this.followComment.pictureUrl || '';
|
||||||
|
return urls ? urls.split(',') : [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
|
||||||
|
preview(idx){
|
||||||
|
this.$store.commit('SET_COMMENT_PREVIEW', {
|
||||||
|
...this.commentDetail,
|
||||||
|
commentContent : this.followComment.commentContent,
|
||||||
|
pictureUrl : this.followComment.pictureUrl
|
||||||
|
});
|
||||||
|
this.$Router.push({
|
||||||
|
path : '/goodsCommentPreview',
|
||||||
|
query : {
|
||||||
|
idx
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.follow{
|
||||||
|
margin-top: 40rpx;
|
||||||
|
&--title{
|
||||||
|
color: $color-yellow3;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
&--ctx{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 46rpx;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
&--img{
|
||||||
|
|
||||||
|
margin-top: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
&-item{
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
margin:20rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,66 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-20 14:30:45
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-28 21:14:46
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="goods" @click="$Router.push(`/goodsDetail?id=${goods.productId}`)">
|
||||||
|
<image class="goods--img" :src="goods.productPicture" mode="aspectFit" ></image>
|
||||||
|
<view class="goods--ctx">
|
||||||
|
<view class="goods--title">{{ goods.productName }}</view>
|
||||||
|
<view class="goods--footer">
|
||||||
|
<view class="goods--sku">{{ goods.skuName }}</view>
|
||||||
|
<view><slot name="btns"></slot></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
goods : {
|
||||||
|
type : Object,
|
||||||
|
default : ()=>({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.goods {
|
||||||
|
display: flex;
|
||||||
|
&--img {
|
||||||
|
width: 130rpx;
|
||||||
|
height: 130rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
&--ctx{
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
}
|
||||||
|
&--title{
|
||||||
|
font-size: 28rpx;
|
||||||
|
overflow:hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
&--footer{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
}
|
||||||
|
&--sku{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,93 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-21 15:50:01
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-30 18:00:16
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="top">
|
||||||
|
<u-rate count="5" size="30rpx" :value="commentDetail.commentScore" activeColor="#FFA35B" readonly inactiveColor="#DDD"></u-rate>
|
||||||
|
|
||||||
|
<text class="top--time">{{ FormatDate(commentDetail.createTime, 'yyyy-mm-dd hh:ii') }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="ctx">{{ commentDetail.commentContent }}</view>
|
||||||
|
<view class="img" v-if="imgs.length">
|
||||||
|
<image class="img--item" mode="aspectFit"
|
||||||
|
v-for="(item, idx) in imgs" :src="item" :key="idx" @click="preview(idx)"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {FormatDate} from '@/common/utils';
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
commentDetail : {
|
||||||
|
type : Object,
|
||||||
|
default : () => ({})
|
||||||
|
},
|
||||||
|
imgPreview : {
|
||||||
|
type: Boolean,
|
||||||
|
default : true,
|
||||||
|
require : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
curPreview : -1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed : {
|
||||||
|
imgs (){
|
||||||
|
let urls = this.commentDetail.pictureUrl || '';
|
||||||
|
return urls ? urls.split(',') : [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods:{
|
||||||
|
FormatDate,
|
||||||
|
preview(idx){
|
||||||
|
if(!this.imgPreview){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.$store.commit('SET_COMMENT_PREVIEW', this.commentDetail);
|
||||||
|
this.$Router.push({
|
||||||
|
path : '/goodsCommentPreview',
|
||||||
|
query : {
|
||||||
|
idx
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.top{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
&--time{
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ctx{
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 46rpx;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.img{
|
||||||
|
margin-top: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
&--item{
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
margin:20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,56 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-21 15:59:23
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-30 17:57:25
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="merchant">
|
||||||
|
<view class="merchant--title">
|
||||||
|
<text class="merchant--name">{{merchantComment.userName}}</text>
|
||||||
|
<text class="merchant--time">{{ FormatDate(merchantComment.createTime, 'yyyy-mm-dd hh:ii') }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="merchant--ctx">{{merchantComment.commentContent}}</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {FormatDate} from '@/common/utils';
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
merchantComment : {
|
||||||
|
type : Object,
|
||||||
|
default : () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
FormatDate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.merchant{
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
background: #F5F5F5;
|
||||||
|
&--title{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
&--time{
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
&--ctx,&--name{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,138 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-20 16:36:14
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-30 21:06:31
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="rate" v-if="type === COMMENT.TYPE.COMMENT">
|
||||||
|
<text class="rate--title">满意度评分</text>
|
||||||
|
<u-rate :count="5" v-model="rate" size="47rpx" activeColor="#FFA35B" inactiveColor="#DDD"></u-rate>
|
||||||
|
<text class="rate--desc">{{rateDesc}}</text>
|
||||||
|
</view>
|
||||||
|
<textarea class="textarea" placeholder="从多个维度评价,可以帮助更多想买的人哦~"
|
||||||
|
:maxlength="500" v-model="commentContent"></textarea>
|
||||||
|
<u-upload class="upload"
|
||||||
|
@afterRead="handleUpdateImg" @delete="handleDelImg"
|
||||||
|
:fileList="fileList" :maxCount="6" :previewFullImage="true">
|
||||||
|
</u-upload>
|
||||||
|
<view class="footer">
|
||||||
|
<UiButton type="solid" :disable="isVerify" @click="handleSubmit">
|
||||||
|
{{type === COMMENT.TYPE.COMMENT ? '发表评价' : '发表追评'}}
|
||||||
|
</UiButton>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import UiButton from '@/components/UiButton.vue';
|
||||||
|
import {ApiPostComment} from '@/common/api/comment';
|
||||||
|
import COMMENT from '@/common/dicts/comment';
|
||||||
|
import {uploadFileOss, HandleApiError} from '@/common/utils';
|
||||||
|
export default {
|
||||||
|
components: { UiButton },
|
||||||
|
props:{
|
||||||
|
type : {
|
||||||
|
type : String | Number,
|
||||||
|
default : COMMENT.TYPE.COMMENT
|
||||||
|
},
|
||||||
|
commentDetail : {
|
||||||
|
type : Object,
|
||||||
|
default : ()=> ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
COMMENT,
|
||||||
|
rate : 5,
|
||||||
|
commentContent : '',
|
||||||
|
fileList : []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
isVerify(){
|
||||||
|
if(this.type === COMMENT.TYPE.COMMENT){
|
||||||
|
return !this.rate || !this.commentContent.trim();
|
||||||
|
}else{
|
||||||
|
return !this.commentContent.trim();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isEdit (){
|
||||||
|
return ( this.commentContent || this.fileList.length > 0) ? true : false
|
||||||
|
},
|
||||||
|
rateDesc(){
|
||||||
|
return COMMENT.RATE_LABEL[this.rate-1];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
isEdit(){
|
||||||
|
this.$emit('editChang',this.isEdit)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async handleSubmit(){
|
||||||
|
let data = {
|
||||||
|
commentContent : this.commentContent,
|
||||||
|
commentType : this.type,
|
||||||
|
orderProductId : this.commentDetail.orderProductId,
|
||||||
|
pictureUrl : this.fileList.map(i => i.url).join(',')
|
||||||
|
}
|
||||||
|
if(this.type === COMMENT.TYPE.COMMENT){
|
||||||
|
data.productId = this.commentDetail.productId;
|
||||||
|
data.commentScore = this.rate;
|
||||||
|
}else if(this.type === COMMENT.TYPE.FOLLOW_COMMENT){
|
||||||
|
data.originId = data.parentId = this.commentDetail.id;
|
||||||
|
}
|
||||||
|
const {error, result} = await ApiPostComment(data);
|
||||||
|
if(!HandleApiError(error)){
|
||||||
|
this.commentContent = '';
|
||||||
|
this.fileList = [];
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$emit('submit',result);
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleUpdateImg(val){
|
||||||
|
const {error, result} = await uploadFileOss(val.file, {
|
||||||
|
configId : 'account-comment',
|
||||||
|
serviceName : 'comment'
|
||||||
|
})
|
||||||
|
if(error){
|
||||||
|
uni.$u.toast(error);
|
||||||
|
}
|
||||||
|
this.fileList.push({url : result});
|
||||||
|
},
|
||||||
|
handleDelImg(target){
|
||||||
|
this.fileList.splice(target.index, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.rate{
|
||||||
|
display: flex;
|
||||||
|
margin: 50rpx 0;
|
||||||
|
align-items: center;
|
||||||
|
&--title{
|
||||||
|
font-size: 28rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
&--desc{
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-left: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.textarea{
|
||||||
|
height: 200rpx;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
.footer{
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 50rpx;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,96 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-21 16:01:19
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-07-01 17:55:01
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="thumb">
|
||||||
|
<view class="thumb--item" @click="handleUseful">
|
||||||
|
<u-icon name="thumb-up-fill" v-if="isLike"></u-icon>
|
||||||
|
<u-icon name="thumb-up" v-else></u-icon>
|
||||||
|
<text>{{usefulCount}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="thumb--item" @click="$Router.push(`/goodsCommentDetail?id=${commentDetail.id}`)">
|
||||||
|
<u-icon name="chat"></u-icon>
|
||||||
|
<text>{{commentDetail.replyCount}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {Debounce, HandleApiError} from '@/common/utils';
|
||||||
|
import {ApiPutCommentUseful} from '@/common/api/comment'
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
commentDetail : {
|
||||||
|
type : Object,
|
||||||
|
default : ()=>({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
debounce : null,
|
||||||
|
isLike : false,
|
||||||
|
usefulCount : 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch :{
|
||||||
|
commentDetail :{
|
||||||
|
handler(){
|
||||||
|
this.isLike = this.commentDetail.isLike;
|
||||||
|
this.usefulCount = this.commentDetail.usefulCount;
|
||||||
|
},
|
||||||
|
deep:true
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.isLike = this.commentDetail.isLike;
|
||||||
|
// console.log('---',this.isLike,this.commentDetail.usefulCount);
|
||||||
|
this.usefulCount = this.commentDetail.usefulCount;
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
handleUseful(){
|
||||||
|
this.isLike = !this.isLike
|
||||||
|
if(this.isLike){
|
||||||
|
this.usefulCount++;
|
||||||
|
}else{
|
||||||
|
this.usefulCount--;
|
||||||
|
}
|
||||||
|
if(!this.debounce){
|
||||||
|
this.debounce = Debounce(this.updateUseFul, 500);
|
||||||
|
}
|
||||||
|
this.debounce();
|
||||||
|
},
|
||||||
|
async updateUseFul(){
|
||||||
|
if(this.isLike === this.commentDetail.isLike){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const {error, result} = await ApiPutCommentUseful({
|
||||||
|
commentId : this.commentDetail.id,
|
||||||
|
isLike : this.isLike
|
||||||
|
});
|
||||||
|
HandleApiError(error);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.thumb{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
&--item{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 50rpx;
|
||||||
|
text{
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,47 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-06-21 22:27:52
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-07-01 17:14:36
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="comment-user">
|
||||||
|
<image class="comment-user--avatr" :src="userData.userAvatar" shape="circle"/>
|
||||||
|
<view>
|
||||||
|
<view class="comment-user--name">{{userData.userName}}</view>
|
||||||
|
<text class="comment-user--sku" v-if="userData.skuName">已购买{{userData.skuName}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props : {
|
||||||
|
userData : {
|
||||||
|
type : Object,
|
||||||
|
default : ()=> ({})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.comment-user{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
&--avatr{
|
||||||
|
width: 71rpx;
|
||||||
|
height: 71rpx;
|
||||||
|
margin-right: 17rpx;
|
||||||
|
}
|
||||||
|
&--name{
|
||||||
|
margin-top: 5rpx;
|
||||||
|
}
|
||||||
|
&--sku{
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,160 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: ch
|
||||||
|
* @Date: 2022-03-26 14:32:03
|
||||||
|
* @LastEditors: ch
|
||||||
|
* @LastEditTime: 2022-06-02 18:07:09
|
||||||
|
* @Description: file content
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<view class="main">
|
||||||
|
<view class="msg-item" v-for="item in msgData" :key="item.id">
|
||||||
|
<view class="msg-item--title">
|
||||||
|
<text>{{item.payload.title }}</text>
|
||||||
|
<text class="msg-item--time">{{FormatDate(item.createTimeStamp, 'mm-dd hh:ii:ss')}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="msg-item--con" @click="handleDetail(item)">
|
||||||
|
<image class="msg-item--img" :src="item.payload.productImageUrls ? item.payload.productImageUrls[0] : require('@/static/message/xt.png')" mode="widthFix"/>
|
||||||
|
<view class="msg-item--desc">
|
||||||
|
<view >{{item.payload.content}}</view>
|
||||||
|
<template v-if="item.payload.customType === 'orderAutoDelivery'">
|
||||||
|
<template v-for="i in item.payload.virtualProductContentList">
|
||||||
|
<text class="msg-item--desc-link" v-if="i.shipType === 1" @click="openLink(i)" :key="i.shipContent">[下载文件]</text>
|
||||||
|
<text v-else :key="i.shipContent">{{i.shipContent}}</text>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-loadmore status="loading" v-if="!msgData || !msgData.length"/>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {Im, CreateUUID, ToAsyncAwait, FormatDate} from '@/common/utils';
|
||||||
|
export default {
|
||||||
|
data(){
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
curSessionData(){
|
||||||
|
const data = this.$store.state.imData.find(i =>i.id == this.$Route.query.sessionId) || {}
|
||||||
|
if(data.id){
|
||||||
|
Im.setCurSessionId(data.id);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
msgData (){
|
||||||
|
let data = this.curSessionData ? this.curSessionData.messageList : [];
|
||||||
|
return Object.assign([],data).reverse();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
curSessionData(){
|
||||||
|
this.setTitle();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom(){
|
||||||
|
this.getHistoryMsg();
|
||||||
|
},
|
||||||
|
onShow(){
|
||||||
|
if(!this.$route.query.sessionId){
|
||||||
|
this.$Router.back();
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.getHistoryMsg();
|
||||||
|
this.readMsg();
|
||||||
|
this.setTitle();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
FormatDate : FormatDate,
|
||||||
|
/**
|
||||||
|
* 获取历史消息
|
||||||
|
*/
|
||||||
|
setTitle(){
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title : this.curSessionData?.fromNickname || '系统消息'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async getHistoryMsg(){
|
||||||
|
this.loading = true;
|
||||||
|
await ToAsyncAwait(Im.getHistoryMsg());
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 把当前会话消息置为已读
|
||||||
|
*/
|
||||||
|
async readMsg(){
|
||||||
|
Im.setRead({
|
||||||
|
content: {
|
||||||
|
sessionId : this.$route.query.sessionId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 点击详情跳转
|
||||||
|
*/
|
||||||
|
handleDetail(item){
|
||||||
|
if(['orderPay','orderDelivery','orderCancel'].includes(item.payload.customType)){
|
||||||
|
this.$Router.push(`/orderDetail?id=${item.payload.primaryId}`)
|
||||||
|
}else if(['refundFail','refundSuccess'].includes(item.payload.customType)){
|
||||||
|
this.$Router.push(`/saleAfterDetail?id=${item.payload.primaryId}`)
|
||||||
|
}else if(item.payload.linkJump){
|
||||||
|
// #ifdef H5
|
||||||
|
window.location.href = item.payload.linkJump;
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.openURL(item.payload.linkJump);
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openLink(item){
|
||||||
|
debugger
|
||||||
|
if(item.shipType === 1){
|
||||||
|
// #ifdef H5
|
||||||
|
window.location.href = item.shipContent;
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.openURL(item.shipContent);
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.msg-item{
|
||||||
|
padding: 40rpx 0 0 40rpx;
|
||||||
|
&--title{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding-right: 40rpx;
|
||||||
|
font-size: $font-size-lg;
|
||||||
|
color: $color-grey6;
|
||||||
|
}
|
||||||
|
&--time{
|
||||||
|
font-size: $font-size-sm;
|
||||||
|
color: $color-grey4;
|
||||||
|
}
|
||||||
|
&--con{
|
||||||
|
display: flex;
|
||||||
|
border-bottom: 1px solid $color-grey2;
|
||||||
|
padding: 40rpx 0;
|
||||||
|
}
|
||||||
|
&--img{
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin-right: 40rpx;
|
||||||
|
}
|
||||||
|
&--desc{
|
||||||
|
width: 455rpx;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
line-height: 39rpx;
|
||||||
|
color: $color-grey5;
|
||||||
|
&-link{
|
||||||
|
color: $color-yellow4;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue