Commit 6f8cab2a authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents 6af8d534 f8bb17e0
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002", "@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
"@typescript-eslint/parser": "6.15.0", "@typescript-eslint/parser": "6.15.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"qrcode": "^1.5.3",
"vue": "^3.3.11", "vue": "^3.3.11",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"wot-design-uni": "^1.2.26" "wot-design-uni": "^1.2.26"
...@@ -7194,6 +7195,15 @@ ...@@ -7194,6 +7195,15 @@
} }
} }
}, },
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/decimal.js": { "node_modules/decimal.js": {
"version": "10.4.3", "version": "10.4.3",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz", "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz",
...@@ -7337,6 +7347,12 @@ ...@@ -7337,6 +7347,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
} }
}, },
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
"license": "MIT"
},
"node_modules/dir-glob": { "node_modules/dir-glob": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-3.0.1.tgz", "resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-3.0.1.tgz",
...@@ -7420,7 +7436,12 @@ ...@@ -7420,7 +7436,12 @@
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true, "license": "MIT"
},
"node_modules/encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/encodeurl": { "node_modules/encodeurl": {
...@@ -8863,8 +8884,6 @@ ...@@ -8863,8 +8884,6 @@
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true,
"peer": true,
"engines": { "engines": {
"node": "6.* || 8.* || >= 10.*" "node": "6.* || 8.* || >= 10.*"
} }
...@@ -9665,7 +9684,6 @@ ...@@ -9665,7 +9684,6 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=8" "node": ">=8"
...@@ -12990,8 +13008,6 @@ ...@@ -12990,8 +13008,6 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
...@@ -13656,6 +13672,24 @@ ...@@ -13656,6 +13672,24 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/qrcode": {
"version": "1.5.3",
"resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.3.tgz",
"integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==",
"license": "MIT",
"dependencies": {
"dijkstrajs": "^1.0.1",
"encode-utf8": "^1.0.3",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qrcode-reader": { "node_modules/qrcode-reader": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmmirror.com/qrcode-reader/-/qrcode-reader-1.0.4.tgz", "resolved": "https://registry.npmmirror.com/qrcode-reader/-/qrcode-reader-1.0.4.tgz",
...@@ -13670,6 +13704,175 @@ ...@@ -13670,6 +13704,175 @@
"qrcode-terminal": "bin/qrcode-terminal.js" "qrcode-terminal": "bin/qrcode-terminal.js"
} }
}, },
"node_modules/qrcode/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/qrcode/node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/qrcode/node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/qrcode/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/qrcode/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/qrcode/node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"license": "MIT",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"license": "MIT",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/qrcode/node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"license": "MIT",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qrcode/node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"license": "ISC"
},
"node_modules/qrcode/node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"license": "MIT",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/qrcode/node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/qs": { "node_modules/qs": {
"version": "6.11.0", "version": "6.11.0",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz", "resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz",
...@@ -13881,12 +14084,16 @@ ...@@ -13881,12 +14084,16 @@
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"dev": true,
"peer": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"license": "ISC"
},
"node_modules/requires-port": { "node_modules/requires-port": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/requires-port/-/requires-port-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/requires-port/-/requires-port-1.0.0.tgz",
...@@ -14379,6 +14586,12 @@ ...@@ -14379,6 +14586,12 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
"node_modules/set-function-length": { "node_modules/set-function-length": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz", "resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz",
...@@ -14585,7 +14798,6 @@ ...@@ -14585,7 +14798,6 @@
"version": "4.2.3", "version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"emoji-regex": "^8.0.0", "emoji-regex": "^8.0.0",
...@@ -15992,6 +16204,12 @@ ...@@ -15992,6 +16204,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz",
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"license": "ISC"
},
"node_modules/which-typed-array": { "node_modules/which-typed-array": {
"version": "1.1.15", "version": "1.1.15",
"resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.15.tgz", "resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.15.tgz",
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002", "@dcloudio/uni-quickapp-webview": "3.0.0-4000720240327002",
"@typescript-eslint/parser": "6.15.0", "@typescript-eslint/parser": "6.15.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"qrcode": "^1.5.3",
"vue": "^3.3.11", "vue": "^3.3.11",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"wot-design-uni": "^1.2.26" "wot-design-uni": "^1.2.26"
......
...@@ -8,3 +8,30 @@ export function getOrderList(data) { ...@@ -8,3 +8,30 @@ export function getOrderList(data) {
data, data,
}); });
} }
// 订单列表接口
export function getOrderDetail(data) {
return request({
url: '/sgyrdd/sgyOrder/groupBuy/orderInfo',
method: 'GET',
data,
});
}
// 商品详情接口
export function getProdDetail(data) {
return request({
url: '/sgyrdd/prod/getProd',
method: 'GET',
data,
});
}
// 商铺详情接口
export function getShopDetail(data) {
return request({
url: '/sgyrdd/shop/getById',
method: 'GET',
data,
});
}
import { request } from '../utils/request';
// 套餐详情
export function getProdDetail(data) {
return request({
url: `/sgyrdd/prod/getProd?prodId=${data}`,
method: 'GET',
});
}
// 套餐详情
export function getCollect(data) {
return request({
url: `/sgyrdd/shop/collect?shopId=${data}`,
method: 'GET',
});
}
import { request } from '../utils/request'; import { request } from '../utils/request';
// 分类 // 店铺信息
export function getStoreInformation(data) { export function getStoreInformation(data) {
return request({ return request({
url: `/sgyrdd/shop/getById?shopId=${data}`, url: `/sgyrdd/shop/getById?shopId=${data}`,
method: 'GET', method: 'GET',
}); });
} }
// 店铺信息
export function groupBuyList(data) {
return request({
url: `/sgyrdd/prod/groupBuyList?shopId=${data}`,
method: 'GET',
});
}
// 商家评论列表分页
export function getEvaluationPage(data) {
return request({
url: `/sgyrdd/evaluation/page`,
method: 'GET',
data,
});
}
// 获取商家优惠券
export function couponShopList(data) {
return request({
url: `/sgyrdd/coupon/couponShopList/${data}`,
method: 'GET',
});
}
// 评论
export function likeOrDislike(data) {
return request({
url: `/sgyrdd/evaluation/likeOrDislike`,
method: 'POST',
data,
});
}
// 周边推荐
export function peripheryRecom(data) {
return request({
url: `/sgyrdd/category/peripheryRecomm`,
method: 'GET',
data,
});
}
// 商家列表分页-搜索列表
export function sgyrddShopPage(data) {
return request({
url: `/sgyrdd/shop/page`,
method: 'GET',
data,
});
}
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4633414 */ font-family: "iconfont"; /* Project id 4633414 */
src: url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.woff2?t=1722311537248') format('woff2'), src: url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.woff2?t=1722502888587') format('woff2'),
url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.woff?t=1722311537248') format('woff'), url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.woff?t=1722502888587') format('woff'),
url('//at.alicdn.com/t/c/font_4633414_xeh7f81eleh.ttf?t=1722311537248') format('truetype'); url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.ttf?t=1722502888587') format('truetype');
} }
.iconfont { .iconfont {
...@@ -13,6 +13,22 @@ ...@@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-shuangxiajiantou:before {
content: "\e660";
}
.icon-dianzan:before {
content: "\e602";
}
.icon-dianzan_kuai:before {
content: "\ec8c";
}
.icon-xiai:before {
content: "\e601";
}
.icon-tongzhi:before { .icon-tongzhi:before {
content: "\e60d"; content: "\e60d";
} }
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
{ {
"path": "pages/shop/shop", "path": "pages/shop/shop",
"style": { "style": {
"navigationBarTitleText": "店铺首页" "navigationBarTitleText": "店铺首页",
"onReachBottomDistance":50
} }
}, },
{ {
...@@ -81,6 +82,13 @@ ...@@ -81,6 +82,13 @@
"navigationBarTitleText": "支付成功" "navigationBarTitleText": "支付成功"
} }
} }
,
{
"path": "pages/order/remark",
"style": {
"navigationBarTitleText": "美食评论"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationStyle": "custom" "navigationStyle": "custom"
......
...@@ -37,6 +37,7 @@ const handleBack = () => { ...@@ -37,6 +37,7 @@ const handleBack = () => {
position: fixed; position: fixed;
z-index: 999; z-index: 999;
width: 375 * 2rpx; width: 375 * 2rpx;
top: 0;
.headbox { .headbox {
position: relative; position: relative;
......
<template> <template>
<view class="content"> <view class="content" v-if="dataList.length > 0">
<view class="box"> <view class="box" v-for="(item, index) in dataList" :key="index">
<view class="header"> <view class="header" @click="handleDetail(item.orderNumber)">
<view class="left"> <view class="left">
<image src="@/static/order/shop.png" /> <image src="@/static/order/shop.png" />
<view class="title">宽带融合5G 169套餐</view> <view class="title">{{ item.shopName }}</view>
</view> </view>
<span class="status">待消费</span> <span class="status">{{ statusList[item.status] }}</span>
</view> </view>
<view class="info"> <view class="info" @click="handleDetail(item.orderNumber)">
<image <image mode="aspectFill" :src="fileDomain + item.orderItems[0].pic" />
mode="aspectFill"
src="https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg"
/>
<view class="info-box"> <view class="info-box">
<view class="text">下单时间:2023-06-27 15:53</view> <view class="text">下单时间:{{ item.createTime }}</view>
<view class="text">预约时间:2023-07-04 10:00-12:00</view> <view class="text">预约时间:{{ item.receiverTime }}</view>
<view class="text">数量:1</view> <view class="text">数量:{{ item.orderItems[0].prodCount }}</view>
<view class="text">实付:¥169</view> <view class="text">实付:¥{{ item.actualTotal }}</view>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<view class="btn-info">删除</view> <view class="btn-info" v-if="item.status == 5 || item.status == 6">删除</view>
<view class="btn-info">查看预约</view> <view class="btn-info" v-if="item.status == 3" @click="handleDetail(item.orderNumber)">
<view class="btn-error">再来一单</view> 查看预约
</view>
<view class="btn-info" v-if="item.status == 1">取消订单</view>
<view class="btn-info">联系商家</view>
<view class="btn-error" v-if="item.status == 7">售后详情</view>
<view class="btn-error" v-if="item.status == 2 || item.status == 3 || item.status == 4">
申请退款
</view>
<view class="btn-error" v-if="item.status == 5">再来一单</view>
<view class="btn-error" v-if="item.status == 1">立即支付</view>
</view> </view>
</view> </view>
<wd-loadmore :state="state" @reload="loadmore" /> <wd-loadmore :state="state" @reload="getList" />
</view> </view>
<wd-status-tip image="content" tip="暂无内容" v-else />
</template> </template>
<script setup> <script setup>
import { getOrderList } from '@/api/order'; import { getOrderList } from '@/api/order';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const emits = defineEmits(['refresh']);
const state = ref('loading'); const state = ref('loading');
const page = reactive({ const catalog = reactive({
pageNum: 0, current: 0,
pageSize: 10, size: 10,
startDate: '',
endDate: '',
keyword: '',
status: '', // 订单状态,1-待付款,2-待接单,3-待取货,4-待评价,5-完成,6-取消,7-退款
}); });
const statusList = ref({
1: '待付款',
3: '待消费',
4: '待评价',
5: '已完成',
6: '已取消',
7: '已退款',
});
const total = ref(0);
const dataList = ref([]);
const num = ref(0); const getList = async () => {
const max = ref(60); catalog.current++;
onReachBottom(() => { state.value = 'loading';
if (num.value === 45) { const res = await getOrderList(catalog);
if (res.code === 0) {
if (res.data.records.length > 0) {
dataList.value.push(...res.data.records);
total.value = res.data.total;
console.log(total.value);
} else {
state.value = 'finished';
}
} else {
state.value = 'error'; state.value = 'error';
} else if (num.value < max.value) { }
getList(); };
} else if (num.value === max.value) { getList();
onReachBottom(() => {
if (dataList.value.length >= total.value) {
state.value = 'finished'; state.value = 'finished';
} else {
getList();
} }
}); });
const getList = async () => { const handleDetail = (id) => {
const res = await getOrderList(); uni.navigateTo({
state.value = 'loading'; url: `/pages/order/detail?orderNumber=${id}`,
console.log(res); });
}; };
getList(); const handleRefresh = (e) => {
catalog.status = e;
if (e === '0') {
catalog.status = '';
}
catalog.current = 0;
dataList.value = [];
total.value = 0;
getList();
};
defineExpose({
refresh: handleRefresh,
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -69,6 +120,7 @@ getList(); ...@@ -69,6 +120,7 @@ getList();
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 20rpx; padding: 20rpx;
gap: 24rpx;
.box { .box {
background-color: #fff; background-color: #fff;
......
<template> <template>
<view class="container"> <view class="container">
<Header title="订单详情"></Header> <Header title="订单详情"></Header>
<view class="content"> <view class="content" v-if="orderDetail">
<!-- 使用状态 --> <!-- 使用状态 -->
<view class="status"> <view class="status">
<view class="status-box"> <view class="status-box">
<!-- <wd-icon name="check-outline" size="26px" color="#333"></wd-icon> --> <wd-icon
<view class="status-text">待到店使用</view> name="check-outline"
size="26px"
color="#333"
v-if="orderDetail.status == 5 || orderDetail.status == 7"
></wd-icon>
<wd-icon
name="close-outline"
size="26px"
color="#333"
v-if="orderDetail.status == 6"
></wd-icon>
<view class="status-text">{{ statusList[orderDetail.status] }}</view>
</view>
<view class="detail" v-if="orderDetail.status == 3">
请在{{ orderDetail.receiverTime.slice(0, 4) }}{{
orderDetail.receiverTime.slice(5, 7)
}}{{ orderDetail.receiverTime.slice(8, 10) }}前到店消费
</view> </view>
<view class="detail">请在2023年07月04前到店消费</view>
</view> </view>
<!-- 券码信息 --> <!-- 券码信息 -->
<view class="info"> <view class="info">
<view class="box"> <view class="box">
<view class="left"> <view class="left">
<image <image mode="aspectFill" :src="fileDomain + orderDetail.orderItems[0].pic" />
mode="aspectFill"
src="https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg"
/>
<view class="left-box"> <view class="left-box">
<text class="title">酸汤鱼双人套餐</text> <text class="title">{{ orderDetail.orderItems[0].prodName }}</text>
<text class="detail">周一至周日 到店吃</text> <text class="detail">周一至周日 到店吃</text>
<text class="detail">随时退·过期自动退·免预约</text> <text class="detail">随时退·过期自动退·免预约</text>
<view class="price-box"> <view class="price-box">
<text class="icon"></text> <text class="icon"></text>
<text class="price">89</text> <text class="price">{{ orderDetail.orderItems[0].price }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -36,41 +48,51 @@ ...@@ -36,41 +48,51 @@
<view class="qrcode line"> <view class="qrcode line">
<!-- 二维码 --> <!-- 二维码 -->
<view class="qr-box"> <view class="qr-box">
<image src="@/static/order/QR-code.png" class="qr"></image> <image :src="qrcode" class="qr"></image>
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="between"> <view class="between">
<view class="column"> <view class="column">
<text class="title">券码信息(1张可用)</text> <text class="title">券码信息(1张可用)</text>
<text class="text">2023-07-04 23:59 到期</text> <text class="text">{{ orderDetail.receiverTime }} 到期</text>
</view> </view>
<view class="btn">申请退款</view> <view class="btn">申请退款</view>
</view> </view>
<view class="between"> <view class="between">
<text class="phone">0115 8156 9126</text> <text
<text class="text">待使用</text> :class="
orderDetail.status == 5 || orderDetail.status == 6 || orderDetail.status == 7
? 'linethrough'
: 'phone'
"
>
{{ orderDetail.orderNumber.slice(6) }}
</text>
<text class="text">{{ orderStatusList[orderDetail.status] }}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 地址 --> <!-- 地址 -->
<view class="info"> <view class="info" v-if="shopDetail">
<view class="info-box padding"> <view class="info-box padding">
<view class="between" style="margin-bottom: 0"> <view class="between" style="margin-bottom: 0">
<text class="name">老凯里酸汤(花果园店)</text> <text class="name">{{ shopDetail.shopName }}</text>
<view class="rowbox"> <view class="rowbox" @tap="callShopPhone(shopDetail.phone)">
<image src="@/static/order/telephone.png" class="img"></image> <image src="@/static/order/telephone.png" class="img"></image>
<text class="text">联系商家</text> <text class="text">联系商家</text>
</view> </view>
</view> </view>
<view class="rowbox"> <view class="rowbox">
<image src="@/static/order/time.png" class="img1"></image> <image src="@/static/order/time.png" class="img1"></image>
<text class="address">营业时间 10:00-00:00</text> <text class="address">
营业时间 {{ shopDetail.transactionStart }}-{{ shopDetail.transactionEnd }}
</text>
</view> </view>
<view class="rowbox"> <view class="rowbox">
<image src="@/static/order/address.png" class="img1"></image> <image src="@/static/order/address.png" class="img1"></image>
<text class="address">南明区花果园中环广场2号楼3楼119号门面 距您300m</text> <text class="address">{{ shopDetail.shopAddress }} 距您{{ shopDetail.distance }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -85,7 +107,7 @@ ...@@ -85,7 +107,7 @@
<text class="h-name">锅底</text> <text class="h-name">锅底</text>
</view> </view>
<view class="list-box"> <view class="list-box">
<text class="name">苗家酸汤锅底 ></text> <text class="name">苗家酸汤锅底</text>
<view class="right-box"> <view class="right-box">
<text class="num">(1份)</text> <text class="num">(1份)</text>
<view class="price-box"> <view class="price-box">
...@@ -138,50 +160,50 @@ ...@@ -138,50 +160,50 @@
<!-- 订单详情 --> <!-- 订单详情 -->
<view class="info"> <view class="info">
<view class="tips padding"> <view class="tips padding">
<text class="title">实付金额:¥89</text> <text class="title">实付金额:¥{{ orderDetail.actualTotal }}</text>
<view class="tips-box"> <view class="tips-box">
<view class="row"> <view class="row">
<text class="name">订单号</text> <text class="name">订单号</text>
<text class="colon"></text> <text class="colon"></text>
<view class="copybox"> <view class="copybox">
<text class="text">491758727559582056</text> <text class="text">{{ orderDetail.orderNumber }}</text>
<view class="copy">复制</view> <view class="copy">复制</view>
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<text class="name">手机号</text> <text class="name">手机号</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">187****8562</text> <text class="text">{{ maskPhoneNumber(orderDetail.receiverMobile) }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">付款时间</text> <text class="name">付款时间</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">2023-06-27 15:53:05</text> <text class="text">{{ orderDetail.payTime }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">下单时间</text> <text class="name">下单时间</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">2023-06-27 15:53:05</text> <text class="text">{{ orderDetail.createTime }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">数量</text> <text class="name">数量</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">1</text> <text class="text">{{ orderDetail.orderItems[0].prodCount }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">总价</text> <text class="name">总价</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">120</text> <text class="text">{{ orderDetail.total }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">优惠明细</text> <text class="name">优惠明细</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">-¥31</text> <text class="text">-¥{{ orderDetail.reduceAmount }}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="name">实付</text> <text class="name">实付</text>
<text class="colon"></text> <text class="colon"></text>
<text class="text">89</text> <text class="text">{{ orderDetail.actualTotal }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -198,6 +220,115 @@ ...@@ -198,6 +220,115 @@
<script setup> <script setup>
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import QRCode from 'qrcode';
import { getOrderDetail, getShopDetail, getProdDetail } from '@/api/order';
import { getDistance } from '@/utils/common';
onShow(() => {
// 获取位置
getLocationFn();
});
// 当前位置的经纬度
const currentLatitudeAndLongitude = ref({ latitude: 0, longitude: 0 });
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const statusList = ref({
1: '待付款',
2: '待到店使用',
3: '待到店使用',
4: '待评价',
5: '已完成',
6: '已取消',
7: '已退款',
});
const orderStatusList = ref({
1: '待付款',
2: '待使用',
3: '待使用',
4: '待评价',
5: '已完成',
6: '已取消',
7: '已退款',
});
const orderNumber = ref('');
onLoad((options) => {
orderNumber.value = options.orderNumber;
console.log(orderNumber.value);
getDetail();
});
// 获取订单详情
const orderDetail = ref();
const getDetail = async () => {
const res = await getOrderDetail({ orderNumber: orderNumber.value });
if (res.code === 0) {
orderDetail.value = res.data;
codeDetail(orderDetail.value.orderNumber);
getProductDetail(orderDetail.value.orderItems[0].prodId);
getShopMailDetail(orderDetail.value.shopId);
}
};
// 生成二维码
const qrcode = ref('');
const codeDetail = (item) => {
const data = {
type: 'write-off',
no: item,
};
QRCode.toDataURL(JSON.stringify(data)).then((img) => {
qrcode.value = img;
});
};
// 获取商品详情
const prodDetail = ref();
const getProductDetail = async (id) => {
const res = await getProdDetail({ prodId: id });
if (res.code === 0) {
prodDetail.value = res.data.data;
}
};
// 获取商铺信息
const shopDetail = ref();
const getShopMailDetail = async (id) => {
const res = await getShopDetail({ shopId: id });
if (res.code === 0) {
shopDetail.value = res.data.shop;
}
};
const maskPhoneNumber = (phone) => {
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
};
function getLocationFn() {
xma.getLocation({
type: 'wgs84',
success: function (res) {
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude);
shopDetail.value.distance = distance;
},
fail: function (err) {
return err;
},
});
}
/**
* 拨打商家电话
* @param {*} phoneNumber
*/
function callShopPhone(phoneNumber) {
xma.makePhoneCall({
phoneNumber, // 仅为示例
});
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -335,7 +466,7 @@ page { ...@@ -335,7 +466,7 @@ page {
padding: 30rpx 20rpx 20rpx; padding: 30rpx 20rpx 20rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 36rpx; gap: 20rpx;
.qr-box { .qr-box {
display: flex; display: flex;
...@@ -343,8 +474,8 @@ page { ...@@ -343,8 +474,8 @@ page {
align-items: center; align-items: center;
.qr { .qr {
width: 320rpx; width: 400rpx;
height: 320rpx; height: 400rpx;
} }
} }
} }
...@@ -388,6 +519,13 @@ page { ...@@ -388,6 +519,13 @@ page {
line-height: 24rpx; line-height: 24rpx;
} }
.linethrough {
text-decoration: line-through;
font-size: 28rpx;
line-height: 28rpx;
color: #999;
}
.phone { .phone {
font-size: 28rpx; font-size: 28rpx;
line-height: 28rpx; line-height: 28rpx;
......
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
<view class="container"> <view class="container">
<Header title="全部订单"></Header> <Header title="全部订单"></Header>
<view class="tabs"> <view class="tabs">
<wd-tabs v-model="tab" animated lineWidth="38" lineHeight="3"> <wd-tabs v-model="tab" animated :lineWidth="38" :lineHeight="3" @change="handleChange">
<block v-for="item in tabs" :key="item"> <block v-for="item in tabs" :key="item.value">
<wd-tab :title="`${item}`" :name="item"> <wd-tab :title="`${item.name}`" :name="item.value"></wd-tab>
<OrderList></OrderList>
</wd-tab>
</block> </block>
</wd-tabs> </wd-tabs>
<OrderList ref="OrderListRef"></OrderList>
</view> </view>
</view> </view>
</template> </template>
...@@ -17,8 +16,37 @@ ...@@ -17,8 +16,37 @@
import Header from './components/Header/index.vue'; import Header from './components/Header/index.vue';
import OrderList from './components/OrderList/index.vue'; import OrderList from './components/OrderList/index.vue';
const tabs = ref(['全部', '待付款', '待收货', '待使用', '待评价', '退款/售后']); const tabs = ref([
const tab = ref('待使用'); {
name: '全部',
value: '0',
},
{
name: '待付款',
value: '1',
},
{
name: '待使用',
value: '3',
},
{
name: '待评价',
value: '4',
},
{
name: '退款/售后',
value: '7',
},
]);
const tab = ref('0');
onReachBottom(() => {});
const OrderListRef = ref(null);
const handleChange = (e) => {
tab.value = e.name;
OrderListRef.value.refresh(tab.value);
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
<template>
<view class="container">
<Header title="评论"></Header>
<view class="content">
<view class="remake">
<wd-row>
<wd-col :span="24" custom-class="text">
<h5>老凯里酸汤鱼(花果园M区店)</h5>
</wd-col>
</wd-row>
<wd-row>
<wd-col :span="16">
<span>评分:</span>
<wd-rate v-model="value" />
</wd-col>
<wd-col :span="8"></wd-col>
</wd-row>
</view>
<wd-button type="error" block>发布</wd-button>
</view>
</view>
</template>
<script setup>
import Header from './components/Header/index.vue';
</script>
<style lang="scss" scoped>
.container {
width: 100%;
height: auto;
background: #f4f4f4;
margin-top: 88rpx;
min-height: calc(100vh - 88rpx);
display: flex;
flex-direction: column;
}
.content {
margin: 0 20rpx;
.remake {
width: auto;
height: auto;
background: #ffffff;
border-radius: 16rpx;
margin-top: 25rpx;
margin-bottom: 172rpx;
padding: 20rpx;
.text h5 {
font-weight: 400;
font-size: 32rpx;
color: #333333;
line-height: 32rpx;
text-align: left;
}
}
}
</style>
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
<view class="swiper"> <view class="swiper">
<wd-swiper <wd-swiper
customClass="swiper-custom" customClass="swiper-custom"
:list="swiperList" :list="prodInfo.imgs"
autoplay autoplay
height="512rpx" height="512rpx"
customStyle="border-radius: 0rpx;" customStyle="border-radius: 0rpx;"
:current="current" :current="current"
@click="handleClick" @click="handleClick"
@change="onChange" @change="onChange"
:indicator="{ type: 'dots-bar' }"
></wd-swiper> ></wd-swiper>
</view> </view>
<!-- 轮播-end --> <!-- 轮播-end -->
...@@ -19,12 +20,12 @@ ...@@ -19,12 +20,12 @@
<view class="package-details-num"> <view class="package-details-num">
<view class="num"> <view class="num">
<text class="icon"></text> <text class="icon"></text>
<text class="amount-of-money">88</text> <text class="amount-of-money">{{ prodInfo.price }}</text>
</view> </view>
<view class="num2">128</view> <view class="num2">{{ prodInfo.oriPrice }}</view>
<view class="num3">共省¥30</view> <view class="num3">共省¥{{ (prodInfo.oriPrice - prodInfo.price).toFixed(2) }}</view>
</view> </view>
<view class="title">双人田蛙尝鲜餐(30元代金券一张,除酒水 饮料外全场通用,仅能使用一张)</view> <view class="title">{{ prodInfo.prodName }}</view>
<view class="info-card"> <view class="info-card">
<view class="yh"> <view class="yh">
<text class="yh-name">优惠:</text> <text class="yh-name">优惠:</text>
...@@ -62,14 +63,33 @@ ...@@ -62,14 +63,33 @@
<!-- card-end --> <!-- card-end -->
<view class="rich-text-card"> <view class="rich-text-card">
<text class="title">商品详情</text> <text class="title">商品详情</text>
<rich-text :nodes="'nodes'"></rich-text> <rich-text :nodes="prodInfo.content"></rich-text>
</view> </view>
<view class="rich-text-card"> <view class="rich-text-card">
<text class="title">购买须知</text> <text class="title">购买须知</text>
<rich-text :nodes="'nodes'"></rich-text> <!-- <rich-text :nodes="'nodes'"></rich-text> -->
<view class="rich-more-btn"> <view class="purchase-information" v-if="showRlue">
收起 <view class="purchase-box">
<image src="@/static/shop/more.png"></image> <text class="title">开始时间</text>
<text class="content">{{ prodRlue.createTime }}</text>
</view>
<view class="purchase-box">
<text class="title">结束时间</text>
<text class="content">{{ prodRlue.endTime }}</text>
</view>
<view class="purchase-box">
<text class="title">标签</text>
<text class="content">{{ prodRlue.labelNames }}</text>
</view>
<view class="purchase-box">
<text class="title">规则</text>
<text class="content">{{ prodRlue.rule }}</text>
</view>
</view>
<view class="rich-more-btn" @click="showRlueFn">
{{ showRlue ? '收起' : '展开' }}
<i v-if="showRlue" class="iconfont icon-shuangshangjiantou-"></i>
<i v-else class="iconfont xia icon-shuangxiajiantou"></i>
</view> </view>
</view> </view>
<!-- 使用方法-start --> <!-- 使用方法-start -->
...@@ -101,21 +121,21 @@ ...@@ -101,21 +121,21 @@
<!-- 适用门店 --> <!-- 适用门店 -->
<view class="applicable-stores-card"> <view class="applicable-stores-card">
<text class="title">适用门店</text> <text class="title">适用门店</text>
<text class="goods-name">川心美蛙鱼头火锅(中环广场店)</text> <text class="goods-name">{{ shopInfo.shopName }}</text>
<view class="goods-pf-rs"> <view class="goods-pf-rs">
<text class="goods-fs">4.3</text> <text class="goods-fs">{{ shopInfo.grade }}</text>
<text class="goods-type">火锅</text> <text class="goods-type">火锅</text>
<text class="goods-rs">36/人</text> <!-- <text class="goods-rs">36/人</text> -->
</view> </view>
<text class="distance">距你129m</text> <text class="distance">距你{{ distance }}</text>
<text class="address">后巢乡花果园中环广场3号(M区4栋)3层114号</text> <text class="address">{{ shopInfo.shopAddress }}</text>
</view> </view>
<!-- 适用门店-end --> <!-- 适用门店-end -->
<!-- 底部 --> <!-- 底部 -->
<view class="bottom-operation-bar"> <view class="bottom-operation-bar">
<view class="start"> <view class="start" @click="collectionFn">
<image src="@/static/shop/start.png"></image> <image src="@/static/shop/start.png"></image>
241 {{ shopInfo.privateIntFcount }}
</view> </view>
<view class="start"> <view class="start">
<image src="@/static/shop/share.png"></image> <image src="@/static/shop/share.png"></image>
...@@ -128,11 +148,117 @@ ...@@ -128,11 +148,117 @@
</template> </template>
<script setup> <script setup>
const swiperList = ref([ import { getProdDetail, getCollect } from '@/api/packageDetail';
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg', import { getStoreInformation } from '@/api/shop';
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg', const prodInfo = ref({});
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg', const prodRlue = ref({});
]); const myProdId = ref('');
const current = ref(0);
const showRlue = ref(true);
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const shopInfo = ref({});
const currentLatitudeAndLongitude = ref({});
const shopId = ref('');
onLoad((options) => {
const { prodId } = options;
myProdId.value = prodId;
getProdDetailFn(prodId).then((shopId) => {
getStoreInformationFn(shopId);
});
});
onShow(() => {
// 获取位置
getLocationFn();
});
/**
* 获取套餐详情
* @param {String} prodId
*/
function getProdDetailFn(prodId) {
return new Promise((resolve, reject) => {
getProdDetail(prodId).then((res) => {
if (res.code === 0) {
res.data.data.prod.imgs = res.data.data.prod.imgs.split(',');
res.data.data.prod.imgs.push(res.data.data.prod.pic);
res.data.data.prod.imgs = res.data.data.prod.imgs
.map((item) => {
if (item !== '') {
item = imgUrl + item;
}
return item;
})
.filter((item) => {
return item !== '';
});
prodInfo.value = res.data.data.prod;
prodRlue.value = res.data.data.groupPurchasePackageRule;
shopId.value = res.data.data.prod.shopId;
resolve(res.data.data.prod.shopId);
}
});
});
}
/**
* 获取收藏
*/
function getCollectFn(shopId) {
getCollect(shopId).then((res) => {
if (res.code === 0) {
console.log('111');
}
});
}
function collectionFn() {
console.log('shopInfo.value', shopId.value);
getCollectFn(shopId.value);
}
function getLocationFn() {
xma.getLocation({
type: 'wgs84',
success: function (res) {
const myLatitude = currentLatitudeAndLongitude.value.latitude;
const myLongitude = currentLatitudeAndLongitude.value.longitude;
const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
shopInfo.value.distance = distance;
},
fail: function (err) {
return err;
},
});
}
const showRlueFn = () => {
showRlue.value = !showRlue.value;
};
const handleClick = (e) => {
const { index } = e;
const imgSrc = prodInfo.value.imgs[index];
previewImage(imgSrc);
};
const onChange = (e) => {};
/**
* 图片预览
*/
function previewImage(imgSrc) {
xma.previewImage({
current: imgSrc, // 当前显示图片的链接,不填则默认为 urls 的第一张
urls: [imgSrc], // 需要预览的图片链接列表
});
}
// 获取店铺信息
const getStoreInformationFn = (id) => {
return new Promise((resolve, reject) => {
getStoreInformation(id).then((res) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
shopInfo.value.tagList = res.data.shop.labels.split(',');
currentLatitudeAndLongitude.value.latitude = res.data.shop.location.lat;
currentLatitudeAndLongitude.value.longitude = res.data.shop.location.lon;
resolve();
}
});
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -151,6 +277,9 @@ page { ...@@ -151,6 +277,9 @@ page {
:deep(.wd-swiper__track) { :deep(.wd-swiper__track) {
border-radius: 0; border-radius: 0;
} }
:deep(.wd-swiper-nav--bottom) {
bottom: 100rpx;
}
} }
.package-details-card { .package-details-card {
width: 710rpx; width: 710rpx;
...@@ -190,7 +319,7 @@ page { ...@@ -190,7 +319,7 @@ page {
border-radius: 14rpx 14rpx 14rpx 0rpx; border-radius: 14rpx 14rpx 14rpx 0rpx;
font-size: 10 * 2rpx; font-size: 10 * 2rpx;
margin-left: 10rpx; margin-left: 10rpx;
padding: 2rpx; padding: 4rpx;
color: #ff494e; color: #ff494e;
} }
} }
...@@ -279,11 +408,37 @@ page { ...@@ -279,11 +408,37 @@ page {
margin-top: 10rpx; margin-top: 10rpx;
border-radius: 8 * 2rpx; border-radius: 8 * 2rpx;
box-shadow: 0 -8rpx 22 * 2rpx 0 rgba(255, 255, 255, 0.6); box-shadow: 0 -8rpx 22 * 2rpx 0 rgba(255, 255, 255, 0.6);
.purchase-information {
display: flex;
flex-direction: column;
align-content: flex-start;
.purchase-box {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
.title {
font-size: 11 * 2rpx;
color: #767676;
}
.content {
font-size: 11 * 2rpx;
margin-left: 32rpx;
color: #3d3d3d;
}
}
}
.title { .title {
font-size: 13 * 2rpx; font-size: 13 * 2rpx;
color: #151515; color: #151515;
font-weight: 500; font-weight: 500;
} }
img {
width: 100%;
height: auto;
}
p {
font-size: 22rpx;
}
.rich-more-btn { .rich-more-btn {
width: 315 * 2rpx; width: 315 * 2rpx;
display: flex; display: flex;
...@@ -295,6 +450,10 @@ page { ...@@ -295,6 +450,10 @@ page {
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 0 0 0; padding: 20rpx 0 0 0;
margin-top: 20rpx; margin-top: 20rpx;
.xia {
font-size: 20rpx;
margin-left: 10rpx;
}
image { image {
width: 18rpx; width: 18rpx;
height: 18rpx; height: 18rpx;
...@@ -362,7 +521,7 @@ page { ...@@ -362,7 +521,7 @@ page {
} }
} }
.bottom-operation-bar { .bottom-operation-bar {
width: 100%; width: 750rpx;
background: #fff; background: #fff;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
display: flex; display: flex;
......
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
<view class="search"> <view class="search">
<wd-icon color="#fff" name="thin-arrow-left" class="icon" @tap="back"></wd-icon> <wd-icon color="#fff" name="thin-arrow-left" class="icon" @tap="back"></wd-icon>
<view class="searchBox"> <view class="searchBox">
<image <image class="magnifyingGlass" src="@/static/shop/search.png" mode="aspectFill" />
class="magnifyingGlass"
src="@/static/shop/search.png"
mode="aspectFit|aspectFill|widthFix"
/>
<input type="text" :value="test" class="text" /> <input type="text" :value="test" class="text" />
</view> </view>
<view class="icon-box"> <view class="icon-box">
...@@ -60,28 +56,33 @@ ...@@ -60,28 +56,33 @@
</view> </view>
</view> </view>
<view class="shop-business-hours"> <view class="shop-business-hours">
<texe>营业时间: 11:00-22:30</texe> <texe>营业时间: {{ shopInfo.transactionStart }}-{{ shopInfo.transactionEnd }}</texe>
</view> </view>
</view> </view>
</view> </view>
<view class="shop-info-bottom"> <view class="shop-info-bottom">
<view class="shop-address"> <view class="shop-address">
<text class="shop-distance">距您<150米 {{ shopInfo.area }}</text> <text class="shop-distance">距您{{ shopInfo.distance }} {{ shopInfo.area }}</text>
<text class="shop-address-detail">{{ shopInfo.shopAddress }}(M区3栋)一层104 号</text> <text class="shop-address-detail">{{ shopInfo.shopAddress }}</text>
</view> </view>
<view class="shop-map-phone"> <view class="shop-map-phone">
<image class="img1" src="@/static/shop/map.png"></image> <image
<image src="@/static/shop/phone.png"></image> mode="aspectFill"
@tap="callShopPhone(shopInfo.phone)"
class="img1"
src="@/static/shop/map.png"
></image>
<image mode="aspectFill" src="@/static/shop/phone.png"></image>
</view> </view>
</view> </view>
</view> </view>
<!-- 店铺信息-end --> <!-- 店铺信息-end -->
<view class="shop-info-box"></view> <view class="shop-info-box"></view>
<!-- 补贴 --> <!-- 补贴 -->
<view class="subsidy-content"> <view class="subsidy-content" @click="jumpPage">
<view class="subsidy"> <view class="subsidy">
<image src="@/static/shop/subsidy.png" /> <image mode="aspectFill" src="@/static/shop/subsidy.png" />
<text>立减10元</text> <text>{{ merchantCoupons.activityName }}</text>
</view> </view>
<view class="more"> <view class="more">
<text>更多</text> <text>更多</text>
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
</view> </view>
<!-- 补贴-end --> <!-- 补贴-end -->
<!-- 商品下单列表 --> <!-- 商品下单列表 -->
<view class="goods-list"> <!-- <view class="goods-list">
<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120"> <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
<view :id="i" class="scroll-view-item_H" v-for="i in 10" :key="i"> <view :id="i" class="scroll-view-item_H" v-for="i in 10" :key="i">
<view class="item-box"> <view class="item-box">
...@@ -104,7 +105,7 @@ ...@@ -104,7 +105,7 @@
<text>立即下单 到店秒提</text> <text>立即下单 到店秒提</text>
(共45个商品) (共45个商品)
</wd-button> </wd-button>
</view> </view> -->
<!-- 商品下单列表-end --> <!-- 商品下单列表-end -->
<!-- 团购优惠-start --> <!-- 团购优惠-start -->
<view class="group-buying-discounts"> <view class="group-buying-discounts">
...@@ -113,25 +114,29 @@ ...@@ -113,25 +114,29 @@
<text>团购优惠</text> <text>团购优惠</text>
</view> </view>
<view class="group-buying-list"> <view class="group-buying-list">
<view class="group-buying-item" v-for="i in 3" :key="i"> <view
<image class="goods-picture" src="@/static/shop/ice.png"></image> class="group-buying-item"
v-for="(item, index) in listOfGroupBuyingProducts"
:key="index"
>
<image mode="aspectFill" class="goods-picture" :src="item.pic"></image>
<view class="goods-info-detail"> <view class="goods-info-detail">
<text class="goods-title multi-line">双人田蛙尝鲜餐</text> <text class="goods-title multi-line">{{ item.prodName }}</text>
<text class="yh-fl multi-line">蔬菜免费,米饭免费</text> <text class="yh-fl multi-line">{{ item.brief }}</text>
<text class="yh-time multi-line">周一至周日 11:00-23:00 可用</text> <text class="yh-time multi-line">{{ item.rule }}</text>
<view class="tag-list"> <view class="tag-list">
<view class="tag">过期退</view> <view class="tag">{{ item.labelNames }}</view>
<view class="tag">随时退</view> <!-- <view class="tag">随时退</view> -->
</view> </view>
<view class="price"> <view class="price">
<text class="num0">到手</text> <text class="num0">到手</text>
<text class="num">88</text> <text class="num">{{ item.price }}</text>
<text class="num1">128</text> <text class="num1">{{ item.oriPrice }}</text>
</view> </view>
</view> </view>
<view class="pay"> <view class="pay">
<text class="sold-shares">已售36</text> <text class="sold-shares">已售{{ item.soldNum }}</text>
<view class="my-button-qg">抢购</view> <view class="my-button-qg" @click="jumpProductDetails(item)">抢购</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -145,19 +150,23 @@ ...@@ -145,19 +150,23 @@
</view> </view>
<!-- 评价列表 --> <!-- 评价列表 -->
<view class="reviews-list"> <view class="reviews-list">
<view class="reviews-item" v-for="i in 2" :key="i"> <view class="reviews-item" v-for="(item, index) in commentList" :key="index">
<view class="user-info-box"> <view class="user-info-box">
<view class="u-info-detail"> <view class="u-info-detail">
<!-- 头像 --> <!-- 头像 -->
<image src="@/static/shop/ice.png" class="user-tx"></image> <image
mode="aspectFill"
:src="item.avatar ? item.avatar : '../../static/shop/avatar.png'"
class="user-tx"
></image>
<view class="u-name"> <view class="u-name">
<text>多多团购真好用</text> <text>{{ item.nickName }}</text>
<view class="u-pf"> <view class="u-pf">
<text>5</text> <text>{{ item.descriptionMatches }}</text>
<wd-rate <wd-rate
color="#fff" color="#fff"
readonly readonly
v-model="value" v-model="item.descriptionMatches"
size="18rpx" size="18rpx"
space="8rpx" space="8rpx"
:active-color="['#FA5151']" :active-color="['#FA5151']"
...@@ -165,25 +174,34 @@ ...@@ -165,25 +174,34 @@
</view> </view>
</view> </view>
</view> </view>
<text class="u-time">2024-07-14发表 南明区中环广场</text> <!-- <text class="u-time">{{ item.createTime }}发表 南明区中环广场</text> -->
<text class="u-time">{{ item.createTime }}</text>
</view> </view>
<view class="user-evaluate"> <view class="user-evaluate">
不得不说,味道非常好,很多配菜,份量很足,非常适合几个人聚 一起吃。 {{ item.evaluation }}
</view> </view>
<view class="evaluate-img"> <view class="evaluate-img" v-if="item.images.length > 0">
<image v-for="i in 2" :key="i" src="@/static/shop/ice.png"></image> <image
mode="aspectFill"
@click="previewImage(img)"
v-for="(img, n) in item.images"
:key="n"
:src="img"
></image>
</view> </view>
<view class="u-dz-sc-pl"> <view class="u-dz-sc-pl">
<text class="liulan">浏览 245</text> <!-- <text class="liulan">浏览 245</text> -->
<text class="liulan"></text>
<view class="pl-icon"> <view class="pl-icon">
<view class="icon"> <view class="icon" @tap="giveTheThumbs(item, index)">
<i class="iconfont icon-aixin" /> <i v-if="item.give == 0" class="iconfont icon-aixin" />
<text>抢首赞</text> <i v-else style="color: red" class="iconfont icon-xiai" />
<text>{{ item.giveCount > 0 ? item.giveCount : '抢首赞' }}</text>
</view> </view>
<view class="icon"> <!-- <view class="icon" @tap="collection(item)">
<i class="iconfont icon-shoucang" /> <i class="iconfont icon-shoucang" />
<text>收藏</text> <text>收藏</text>
</view> </view> -->
<!-- <view class="icon"> <!-- <view class="icon">
<i class="iconfont icon-pinglun" /> <i class="iconfont icon-pinglun" />
<text>评论</text> <text>评论</text>
...@@ -191,7 +209,9 @@ ...@@ -191,7 +209,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="u-more">查看全部5条评价</view> <view @tap="viewAll" v-if="commentList.length < commentTotal" class="u-more">
查看全部{{ commentTotal }}条评价
</view>
</view> </view>
<!-- 评价列表-end --> <!-- 评价列表-end -->
</view> </view>
...@@ -201,29 +221,34 @@ ...@@ -201,29 +221,34 @@
<text class="title">周边推荐</text> <text class="title">周边推荐</text>
<view class="tag-list"> <view class="tag-list">
<view <view
@click="changeActie(item.id)" @click="changeActie(item.categoryId)"
:class="activeId == item.id ? 'active-tag' : ''" :class="activeId == item.categoryId ? 'active-tag' : ''"
class="tag" class="tag"
v-for="item in tagList" v-for="item in recommendedTypesOfPeripherals"
:key="item.id" :key="item.categoryId"
> >
{{ item.name }} {{ item.categoryName }}
</view> </view>
</view> </view>
<view class="goods-list-tg"> <view class="goods-list-tg">
<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120"> <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
<view :id="i" class="scroll-view-item_H" v-for="i in 10" :key="i"> <view
:id="i"
class="scroll-view-item_H"
v-for="(item, index) in recommendedListOfPeripherals"
:key="index"
>
<view class="item-box"> <view class="item-box">
<image src="@/static/shop/ice.png"></image> <image mode="aspectFill" :src="imgUrl + item.shopLogo"></image>
<text class="goods-name multi-line">健康生态调味品</text> <text class="goods-name multi-line">{{ item.shopName }}</text>
<view class="goods-pf-rs"> <view class="goods-pf-rs">
<text class="goods-fs">4.3</text> <text class="goods-fs">{{ item.grade }}</text>
<text class="goods-fs-2"></text> <text class="goods-fs-2"></text>
<text class="goods-rs">36/人</text> <!-- <text class="goods-rs">36/人</text> -->
</view> </view>
<view class="tag-list"> <view class="tag-list">
<view class="tag" v-for="item in tagList2" :key="item.id"> <view class="tag" v-for="(el, i) in item.labels" :key="i">
{{ item.name }} {{ el }}
</view> </view>
</view> </view>
</view> </view>
...@@ -241,83 +266,311 @@ ...@@ -241,83 +266,311 @@
</template> </template>
<script setup> <script setup>
import { getStoreInformation } from '@/api/shop'; import {
likeOrDislike,
getStoreInformation,
groupBuyList,
getEvaluationPage,
couponShopList,
peripheryRecom,
sgyrddShopPage,
} from '@/api/shop';
import { debounce, addImgUrlPrefixToImages, getDistance, addImgUrlPrefix } from '@/utils/common';
const imgUrl = import.meta.env.VITE_APP_IMG_URL; const imgUrl = import.meta.env.VITE_APP_IMG_URL;
const current = ref(0); const current = ref(0);
const old = reactive({ scrollTop: 0 }); const old = reactive({ scrollTop: 0 });
const activeId = ref(1); const activeId = ref(1);
// 店铺信息 // 店铺信息
const shopInfo = ref({}); const shopInfo = ref({});
// 店铺轮播图
const shopSwiperList = ref([]); const shopSwiperList = ref([]);
const tagList = ref([ // 当前位置的经纬度
{ name: '美食', id: 1 }, const currentLatitudeAndLongitude = ref({ latitude: 0, longitude: 0 });
{ name: '休闲娱乐', id: 2 }, // 团购商品列表
{ name: '景点', id: 3 }, const listOfGroupBuyingProducts = ref([]);
{ name: '生活服务', id: 4 }, // 商家优惠券
]); const merchantCoupons = ref({});
// 评论分页
const params = ref({
current: 1,
size: 3,
shopId: '1626126617850544129',
isEnd: false,
});
const isLoadReachBottom = ref(null);
// 评价列表
const commentList = ref([]);
// 评论总数
const commentTotal = ref(0);
// 周边推荐类型列表
const recommendedTypesOfPeripherals = ref([]);
// 商户id
const shopId = ref('1626126617850544129');
const tagList2 = ref([{ name: '免费停车', id: 1 }]); const tagList2 = ref([{ name: '免费停车', id: 1 }]);
const swiperList = ref([ // 周边推荐-商家列表
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg', const recommendedListOfPeripherals = ref([]);
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg',
]);
onLoad((options) => { onLoad((options) => {
getStoreInformationFn('1626126617850544129'); getStoreInformationFn('1626126617850544129').then(() => {
peripheryRecomFn();
});
groupBuyListFn('1626126617850544129');
couponShopListFn('1626126617850544129');
getEvaluationPageFn();
}); });
onShow(() => { onShow(() => {
// 获取位置
getLocationFn(); getLocationFn();
}); });
const value = ref(5); const value = ref(5);
const handleClick = (e) => { const handleClick = (e) => {
console.log(e); const { index } = e;
}; const imgSrc = shopSwiperList.value[index];
const onChange = (e) => { previewImage(imgSrc);
console.log(e);
}; };
const onChange = (e) => {};
function scroll(e) { function scroll(e) {
console.log(e);
old.scrollTop = e.detail.scrollTop; old.scrollTop = e.detail.scrollTop;
} }
/**
* 周边推荐类型列表
*/
function peripheryRecomFn() {
// 维度
const lat = currentLatitudeAndLongitude.value.latitude;
// 经度
const lon = currentLatitudeAndLongitude.value.longitude;
peripheryRecom({ lat, lon, distance: 200 }).then((res) => {
if (res.code === 0) {
recommendedTypesOfPeripherals.value = res.data;
const id = recommendedTypesOfPeripherals.value[0].categoryId;
activeId.value = id;
sgyrddShopPageFn(id);
}
});
}
function sgyrddShopPageFn(categoryIds) {
const params = {
current: 1,
size: 15,
lat: currentLatitudeAndLongitude.value.latitude,
lon: currentLatitudeAndLongitude.value.longitude,
categoryIds,
distance: 200,
};
sgyrddShopPage(params).then((res) => {
if (res.code === 0) {
res.data.content = res.data.content
.map((el) => {
if (el.labels && el.labels !== '') {
el.labels = el.labels.split(',');
}
return el;
})
.filter((item) => {
return item !== '';
});
recommendedListOfPeripherals.value = res.data.content;
}
});
}
function getLocationFn() { function getLocationFn() {
// xma.getLocation({ xma.getLocation({
// type: 'wgs84', type: 'wgs84',
// success: function (res) { success: function (res) {
// console.log('经度:' + res.longitude); const myLatitude = currentLatitudeAndLongitude.value.latitude;
// console.log('纬度:' + res.latitude); const myLongitude = currentLatitudeAndLongitude.value.longitude;
// }, const distance = getDistance(res.latitude, res.longitude, myLatitude, myLongitude, 1);
// fail: function (err) { shopInfo.value.distance = distance;
// console.error('获取位置失败:', err); },
// }, fail: function (err) {
// }); return err;
if (navigator.geolocation) { },
navigator.geolocation.getCurrentPosition( });
function (position) {
console.log('经度123:' + position.coords.longitude);
console.log('纬度:' + position.coords.latitude);
},
function (error) {
console.error('获取位置失败:', error);
},
);
} else {
console.error('浏览器不支持Geolocation API');
}
} }
// 获取店铺信息 // 获取店铺信息
const getStoreInformationFn = (id) => { const getStoreInformationFn = (id) => {
getStoreInformation(id).then((res) => { return new Promise((resolve, reject) => {
getStoreInformation(id).then((res) => {
if (res.code === 0) {
shopInfo.value = res.data.shop;
shopSwiperList.value = res.data.imgList.map((item) => imgUrl + item.imgUrl);
shopInfo.value.tagList = res.data.shop.labels.split(',');
currentLatitudeAndLongitude.value.latitude = res.data.shop.location.lat;
currentLatitudeAndLongitude.value.longitude = res.data.shop.location.lon;
resolve();
}
});
});
};
/**
* 获取团购列表
* @param {*} id
*/
const groupBuyListFn = (shopId) => {
groupBuyList(shopId).then((res) => {
if (res.code === 0) {
listOfGroupBuyingProducts.value = res.data.map((item) => {
item.pic = imgUrl + item.pic;
return item;
});
}
});
};
/**
* 获取商家优惠券
*/
const couponShopListFn = (shopId) => {
couponShopList(shopId).then((res) => {
if (res.code === 0) { if (res.code === 0) {
shopInfo.value = res.data.shop; merchantCoupons.value = res.data[0];
shopSwiperList.value = res.data.imgList.map((item) => imgUrl + item.imgUrl);
shopInfo.value.tagList = res.data.shop.labels.split(',');
} }
}); });
}; };
/**
* 获取评价列表
*/
const getEvaluationPageFn = () => {
if (params.value.isEnd === true)
return new Promise((resolve) => {
resolve();
});
xma.showLoading({
title: '加载中...',
mask: true,
});
return getEvaluationPage({
current: params.value.current,
size: params.value.size,
shopId: params.value.shopId,
}).then((res) => {
if (res.code === 0) {
commentTotal.value = res.data.total;
res.data.records = res.data.records.map((item) => {
item.avatar = addImgUrlPrefix(imgUrl, item.avatar);
item.images = addImgUrlPrefixToImages(imgUrl, item.images);
return item;
});
if (res.data.records.length < params.value.size) {
params.value.isEnd = true;
}
params.value.current += 1;
return new Promise((resolve) => {
commentList.value = commentList.value.concat(res.data.records);
xma.hideLoading();
setTimeout(() => {
resolve();
}, 500);
});
}
});
};
function refresh() {
return new Promise((resolve) => {
params.value = {
current: 1,
size: 20,
shopId,
isEnd: false,
};
commentList.value = [];
resolve();
});
}
/**
* 跳转优惠券页面
*/
function jumpPage() {
xma.navigateTo({
url: `/pages/ticket/detail?shopId=${shopId.value}`,
});
}
/**
* 图片预览
*/
function previewImage(imgSrc) {
xma.previewImage({
current: imgSrc, // 当前显示图片的链接,不填则默认为 urls 的第一张
urls: [imgSrc], // 需要预览的图片链接列表
});
}
/**
* 点赞-点赞取消
* @param {*} evaluationId
*/
const likeOrDislikeFn = ({ item, index }) => {
likeOrDislike({ evaluationId: item.evaluationId }).then((res) => {
if (res.code === 0) {
if (item.give === 0) {
item.giveCount++;
item.give = 1;
} else {
item.giveCount--;
item.give = 0;
}
}
});
};
/**
* 跳转到商品详情
*/
function jumpProductDetails(itme) {
xma.navigateTo({
url: `/pages/packageDetails/packageDetails?prodId=${itme.prodId}`,
});
}
/**
* 点赞
* @param {*} item
*/
const giveTheThumbs = (item, index) => {
likeOrDislikeFn({ item, index });
};
/**
* 查看全部评论
*/
const viewAll = () => {
getEvaluationPage({
current: params.value.current,
size: commentTotal.value,
shopId: params.value.shopId,
}).then((res) => {
if (res.code === 0) {
commentList.value = res.data.records.map((item) => {
item.avatar = addImgUrlPrefix(imgUrl, item.avatar);
item.images = addImgUrlPrefixToImages(imgUrl, item.images);
return item;
});
}
});
};
// 创建一个防抖后的函数
const debouncedLog = debounce((id) => {
sgyrddShopPageFn(id);
}, 800);
function changeActie(id) { function changeActie(id) {
activeId.value = id; activeId.value = id;
debouncedLog(id);
}
// onReachBottom(() => {
// console.log('到底了');
// if (isLoadReachBottom.value === true) return;
// isLoadReachBottom.value = true;
// getEvaluationPageFn().then(() => {
// isLoadReachBottom.value = false;
// });
// });
/**
* 拨打商家电话
* @param {*} phoneNumber
*/
function callShopPhone(phoneNumber) {
xma.makePhoneCall({
phoneNumber, // 仅为示例
});
} }
</script> </script>
...@@ -401,6 +654,7 @@ page { ...@@ -401,6 +654,7 @@ page {
// 商家信息 // 商家信息
.shop-info-box { .shop-info-box {
height: 146 * 2rpx; height: 146 * 2rpx;
height: 116 * 2rpx;
} }
.shop-info { .shop-info {
width: 750rpx; width: 750rpx;
...@@ -654,12 +908,15 @@ page { ...@@ -654,12 +908,15 @@ page {
.group-buying-list { .group-buying-list {
width: 100%; width: 100%;
margin-top: 40rpx; margin-top: 40rpx;
background: #fff;
.group-buying-item { .group-buying-item {
border-bottom: 2rpx solid #efefef; border-bottom: 2rpx solid #efefef;
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 40rpx; padding-bottom: 40rpx;
padding-top: 20rpx;
width: 100%; width: 100%;
background: #fdfdfd;
image { image {
width: 60 * 2rpx; width: 60 * 2rpx;
height: 60 * 2rpx; height: 60 * 2rpx;
...@@ -748,7 +1005,7 @@ page { ...@@ -748,7 +1005,7 @@ page {
// 用户评价-start // 用户评价-start
.user-reviews { .user-reviews {
width: 100%; width: 100%;
background-color: #fff; background-color: #fdfdfd;
box-sizing: border-box; box-sizing: border-box;
padding: 11 * 2rpx; padding: 11 * 2rpx;
margin-top: 10rpx; margin-top: 10rpx;
...@@ -818,17 +1075,16 @@ page { ...@@ -818,17 +1075,16 @@ page {
margin-top: 20rpx; margin-top: 20rpx;
} }
.evaluate-img { .evaluate-img {
display: flex; display: grid;
flex-wrap: wrap; width: 100%;
margin-top: 10rpx;
grid-template-columns: repeat(3, 1fr);
// grid-template-rows: repeat(3, 228rpx);
gap: 10px;
image { image {
width: 114 * 2rpx; width: 100%;
height: 114 * 2rpx; height: 114 * 2rpx;
border-radius: 8 * 2rpx; border-radius: 8 * 2rpx;
margin-left: 10rpx;
margin-top: 10rpx;
}
image:nth-child(1) {
margin-left: 0;
} }
} }
.u-dz-sc-pl { .u-dz-sc-pl {
...@@ -874,7 +1130,7 @@ page { ...@@ -874,7 +1130,7 @@ page {
.surrounding-recommendations { .surrounding-recommendations {
width: 100%; width: 100%;
border-radius: 8 * 2rpx 8 * 2rpx 0 0; border-radius: 8 * 2rpx 8 * 2rpx 0 0;
background: #ffffff; background: #fdfdfd;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
...@@ -898,6 +1154,7 @@ page { ...@@ -898,6 +1154,7 @@ page {
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
font-size: 11 * 2rpx; font-size: 11 * 2rpx;
margin-top: 20rpx;
} }
.active-tag { .active-tag {
border-radius: 10 * 2rpx; border-radius: 10 * 2rpx;
...@@ -969,7 +1226,7 @@ page { ...@@ -969,7 +1226,7 @@ page {
box-sizing: border-box; box-sizing: border-box;
padding: 6rpx; padding: 6rpx;
font-size: 8 * 2rpx; font-size: 8 * 2rpx;
margin-right: 20rpx; margin-right: 10rpx;
} }
} }
} }
...@@ -991,3 +1248,4 @@ page { ...@@ -991,3 +1248,4 @@ page {
} }
} }
</style> </style>
@/utils/common.js
// 根据经纬度计算距离,参数分别为第一点的纬度、经度;第二点的纬度、经度
/**
*
* @param {*} lat1 第一个纬度
* @param {*} lng1 第一个经度
* @param {*} lat2 第二个纬度
* @param {*} lng2 第二个经度
* @param {*} type 0 中文 1 英文
* @returns
*/
export function getDistance(lat1, lng1, lat2, lng2, type = 1) {
const R = 6371; // 地球半径,单位为千米
const dLat = deg2rad(lat2 - lat1);
const dLng = deg2rad(lng2 - lng1);
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLng / 2) * Math.sin(dLng / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const distance = R * c;
return distance >= 1
? type === 0
? distance.toFixed(2) + '千米'
: distance.toFixed(2) + 'km'
: type === 1
? (distance * 1000).toFixed(2) + '米'
: (distance * 1000).toFixed(2) + 'm';
}
// 将角度转换为弧度
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
/**
* 更具图片路径返回全路径还是拼接的路径
* @param {*} imgUrl
* @param {*} avatarUrl
* @returns
*/
export function addImgUrlPrefix(imgUrl, avatarUrl) {
// 使用正则表达式检查是否是全路径
const isFullUrl = /^https?:\/\//i.test(avatarUrl);
// 如果不是全路径,添加 imgUrl 前缀
if (!isFullUrl) {
return imgUrl + avatarUrl;
}
// 如果是全路径,直接返回
return avatarUrl;
}
export function addImgUrlPrefixToImages(imgUrl, imagePaths) {
if (imagePaths !== '') {
// 使用逗号分隔的图片路径
const pathsArray = imagePaths.split(',');
// 在每个路径前面添加 imgUrl 前缀
const prefixedPaths = pathsArray.map((path) => imgUrl + path.trim());
// 返回组装好的数组
return prefixedPaths;
} else {
return [];
}
}
// 防抖
export function debounce(func, wait) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, wait);
};
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment