From 5b629d83de981e12855ec1e6f8b3d0d7ad261f14 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 07 八月 2025 19:16:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
manager/src/views/news/index.vue | 149 +++++++++++++++++-------
manager/src/views/order/order/orderList.vue | 12 ++
seller/src/views/login.vue | 44 +++---
manager/src/components/lili-dialog/index.vue | 1
manager/src/views/kitchen/kitchenVideo.vue | 8
manager/src/views/news/video.js | 69 +++++++++++
manager/src/views/promotions/coupon/coupon-publish.vue | 2
manager/src/components/lili-dialog/goods-dialog.vue | 31 +++++
8 files changed, 243 insertions(+), 73 deletions(-)
diff --git a/manager/src/components/lili-dialog/goods-dialog.vue b/manager/src/components/lili-dialog/goods-dialog.vue
index 3126d9b..4ab9d62 100644
--- a/manager/src/components/lili-dialog/goods-dialog.vue
+++ b/manager/src/components/lili-dialog/goods-dialog.vue
@@ -45,6 +45,10 @@
>鎼滅储</Button
>
</div>
+ <div class="query-item">
+ <Checkbox v-model="selectAll" @on-change="handleSelectAll">鍏ㄩ��</Checkbox>
+ </div>
+
</div>
<div>
<div
@@ -96,6 +100,7 @@
type: "multiple", //鍗曢�夋垨鑰呭閫� single multiple
skuList: [], // 鍟嗗搧sku鍒楄〃
total: 0, // 鍟嗗搧鎬绘暟
+ selectAll:false,
goodsParams: {
// 鍟嗗搧璇锋眰鍙傛暟
pageNumber: 1,
@@ -145,12 +150,37 @@
this.init();
},
methods: {
+ handleSelectAll(){
+
+ if (this.selectAll){
+ this.goodsData.forEach(item =>{
+ item.selected = true;
+ const isExist = this.selectedWay.some(selectedItem => selectedItem.id === item.id);
+ if (!isExist) {
+ this.selectedWay.push(item);
+ }
+ })
+
+ }else{
+ this.goodsData.forEach(item =>{
+ item.selected = false;
+ const index = this.selectedWay.findIndex(
+ selectedItem => selectedItem.id === item.id
+ );
+ if (index !== -1) {
+ this.selectedWay.splice(index, 1);
+ }
+ })
+ }
+ console.log(this.selectedWay)
+ },
changePageSize(v){
this.goodsParams.pageNumber = v;
this.getQueryGoodsList();
},
// 鑾峰彇鍟嗗搧鍒楄〃
getQueryGoodsList() {
+
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
this.initGoods(res);
});
@@ -228,6 +258,7 @@
* 鐐瑰嚮鍟嗗搧
*/
checkedGoods(val, index) {
+
// 濡傛灉鍗曢�夌殑璇�
if (this.type != "multiple") {
this.goodsData.forEach((item) => {
diff --git a/manager/src/components/lili-dialog/index.vue b/manager/src/components/lili-dialog/index.vue
index 32a63d0..4a1dbf2 100644
--- a/manager/src/components/lili-dialog/index.vue
+++ b/manager/src/components/lili-dialog/index.vue
@@ -20,6 +20,7 @@
v-else
class="linkDialog"
/>
+
</template>
</Modal>
</template>
diff --git a/manager/src/views/kitchen/kitchenVideo.vue b/manager/src/views/kitchen/kitchenVideo.vue
index 7ba9981..5d9a7e1 100644
--- a/manager/src/views/kitchen/kitchenVideo.vue
+++ b/manager/src/views/kitchen/kitchenVideo.vue
@@ -587,17 +587,15 @@
},
generalQrCode(row){
+ console.log(row)
this.QRCodeUrl = '';
this.showGeneralQrCode = true
console.log('-------------------->',row);
//shareType鍙兘浼氭槸鍔ㄦ�佺殑锛屼細鍔犲垽鏂棰戞潵婧�
- console.log(item)
- // uni.navigateTo({
- // url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`
- // });
+
this.QRCodeUrl = this.codeUrl + '?shareType=cook' + '&videoId='+ row.id + '&source=' + 'system';
//TODO 鏍规嵁瑙嗛淇℃伅涓殑 锛屼綔鑰卛d鑾峰緱鐢ㄦ埛 鍒ゆ柇 鏉ユ簮 锛岀敤鎴蜂綔鑰呯殑uniid涓簄ull鍒欐槸绯荤粺涓婁紶锛屼笉涓虹┖鍒欐槸鐢ㄦ埛涓婁紶
-
+ console.log(this.QRCodeUrl)
// console.log(this.QRCodeUrl)
},
diff --git a/manager/src/views/news/index.vue b/manager/src/views/news/index.vue
index bf83454..81e8cd4 100644
--- a/manager/src/views/news/index.vue
+++ b/manager/src/views/news/index.vue
@@ -53,7 +53,7 @@
<!-- 鎿嶄綔鎸夐挳 -->
<Row class="operation">
- <Button @click="openAdd" type="primary" icon="md-add">鏂板娲诲姩</Button>
+ <Button @click="openAdd" type="primary" icon="md-add">鏂板鏂伴椈</Button>
<Button @click="delBatch" type="error" icon="md-trash" :disabled="selectCount === 0">鎵归噺鍒犻櫎</Button>
</Row>
@@ -134,7 +134,7 @@
</FormItem>
</Col>
<Col span="24">
- <FormItem label="鏂伴椈鍐呭锛�" prop="content">
+ <FormItem label="蹇鍐呭锛�" prop="content">
<Upload
:show-upload-list="false"
ref="upload"
@@ -232,7 +232,7 @@
import 'quill/dist/quill.bubble.css';
import * as Quill from 'quill' //寮曞叆缂栬緫鍣�
-import VideoBlot from '../activity/video.js';
+import VideoBlot from './video.js';
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // 鍔犵矖锛屾枩浣擄紝涓嬪垝绾匡紝鍒犻櫎绾�
@@ -443,10 +443,15 @@
},
mounted() {
//鍒濆鍖�
- this.Quill=this.$refs.QuillEditor.quill
- this.getNewsList();
- this.initTitle();
- this.initButton();
+ this.$nextTick(() => {
+ if (this.$refs.QuillEditor) {
+ this.Quill=this.$refs.QuillEditor.quill
+ this.getNewsList();
+ this.initTitle();
+ this.initButton();
+ }
+ })
+
},
methods:{
onEditorBlur(editor) {
@@ -492,8 +497,57 @@
this.uploadFile2()
return false
},
- uploadFile2() {
+ getFileType(file) {
+ // 鑾峰彇鏂囦欢绫诲瀷鎴栨墿灞曞悕
+ let type, extension;
+ if (file instanceof File) {
+ // 濡傛灉鏄疐ile瀵硅薄
+ type = file.type;
+ const name = file.name.toLowerCase();
+ extension = name.substring(name.lastIndexOf('.') + 1);
+ } else if (typeof file === 'string') {
+ // 濡傛灉鏄瓧绗︿覆锛堟枃浠跺悕鎴朥RL锛�
+ const name = file.toLowerCase();
+ extension = name.substring(name.lastIndexOf('.') + 1);
+
+ // 灏濊瘯浠嶶RL涓彁鍙朚IME绫诲瀷锛堝鏋滄湁锛�
+ const mimeMatch = file.match(/^data:(.+?);/);
+ if (mimeMatch) {
+ type = mimeMatch[1];
+ }
+ } else {
+ return 'unknown';
+ }
+
+ // 甯歌鍥剧墖鍜岃棰戠殑MIME绫诲瀷
+ const imageTypes = [
+ 'image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/bmp', 'image/svg+xml'
+ ];
+
+ const videoTypes = [
+ 'video/mp4', 'video/webm', 'video/ogg', 'video/quicktime', 'video/x-msvideo', 'video/x-matroska'
+ ];
+
+ // 妫�鏌IME绫诲瀷
+ if (type) {
+ if (imageTypes.includes(type)) return 'image';
+ if (videoTypes.includes(type)) return 'video';
+ }
+
+ // 甯歌鍥剧墖鍜岃棰戠殑鎵╁睍鍚�
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'svg'];
+ const videoExtensions = ['mp4', 'webm', 'ogg', 'mov', 'avi', 'mkv'];
+
+ // 妫�鏌ユ枃浠舵墿灞曞悕
+ if (extension) {
+ if (imageExtensions.includes(extension)) return 'image';
+ if (videoExtensions.includes(extension)) return 'video';
+ }
+
+ return 'unknown';
+ },
+ uploadFile2() {
if (!this.file) return
this.submitLoading = true
@@ -505,11 +559,12 @@
let url = res.data.url;
let fileKey = res.data.fileKey;
let fileType = this.getFileType(this.file);
-
+ console.log("鎵撳嵃")
+ console.log(this.Quill);
const range = this.Quill.getSelection();
const index = range ? range.index : this.Quill.getLength();
- console.log("--------");
+ console.log(fileType);
if (fileType === 'video') {
this.Quill.insertEmbed(index, 'video', {
url:url,
@@ -528,6 +583,8 @@
console.log(this.newsForm.content)
this.Quill.setSelection(index + 1);
this.$Message.success('涓婁紶鎴愬姛')
+ }else{
+ this.$Message.error(res.msg)
}
}).catch(() => {
this.submitLoading = false
@@ -551,39 +608,39 @@
saveOrUpdate(){
console.log(this.newsForm)
- // this.$refs.form.validate(valid => {
- // if (valid) {
- // this.submitLoading = true
- // const submitData = {
- // ...this.newsForm,
- // publish: this.newsForm.publish !== 0, // true 鈫� 1, false 鈫� 0
- // };
- // if (this.newsForm.id){
- // editNews(submitData).then(res => {
- // this.submitLoading = false
- // if (res.code === 200) {
- // this.$Message.success(res.msg)
- // this.modelClose()
- // this.getNewsList()
- // }
- // }).catch(() => {
- // this.submitLoading = false
- // })
- // }else {
- // addNews(submitData).then(res => {
- // this.submitLoading = false
- // if (res.code === 200) {
- // this.$Message.success(res.msg)
- // this.modelClose()
- // this.getNewsList()
- // }
- // }).catch(() => {
- // this.submitLoading = false
- // })
- // }
- //
- // }
- // })
+ this.$refs.form.validate(valid => {
+ if (valid) {
+ this.submitLoading = true
+ const submitData = {
+ ...this.newsForm,
+ publish: this.newsForm.publish !== 0, // true 鈫� 1, false 鈫� 0
+ };
+ if (this.newsForm.id){
+ editNews(submitData).then(res => {
+ this.submitLoading = false
+ if (res.code === 200) {
+ this.$Message.success(res.msg)
+ this.modelClose()
+ this.getNewsList()
+ }
+ }).catch(() => {
+ this.submitLoading = false
+ })
+ }else {
+ addNews(submitData).then(res => {
+ this.submitLoading = false
+ if (res.code === 200) {
+ this.$Message.success(res.msg)
+ this.modelClose()
+ this.getNewsList()
+ }
+ }).catch(() => {
+ this.submitLoading = false
+ })
+ }
+
+ }
+ })
},
infoModelClose(){
@@ -617,17 +674,17 @@
},
openEdit(row){
- this.modelTitle = '淇敼鏂伴椈';
+ this.modelTitle = '淇敼蹇';
this.modelShow = true;
this.$refs.form.resetFields();
this.newsForm.title = row.title;
this.newsForm.content = row.content;
this.newsForm.id = row.id;
- this.$refs.editor.setContent(this.newsForm.content)
+ // this.$refs.editor.setContent(this.newsForm.content)
},
openAdd(){
- this.modelTitle = '鏂板鏂伴椈';
+ this.modelTitle = '鏂板蹇';
this.modelShow = true;
this.$refs.form.resetFields()
this.newsForm.id = '';
diff --git a/manager/src/views/news/video.js b/manager/src/views/news/video.js
new file mode 100644
index 0000000..166112f
--- /dev/null
+++ b/manager/src/views/news/video.js
@@ -0,0 +1,69 @@
+import { Quill } from 'vue-quill-editor';
+
+const BlockEmbed = Quill.import('blots/block/embed');
+const Link = Quill.import('formats/link');
+
+const ATTRIBUTES = ['height', 'width', 'controls', 'src', ];
+
+class VideoBlot extends BlockEmbed {
+ static create(value) {
+ const node = super.create();
+
+ if (typeof value === 'object') {
+ node.setAttribute('src', this.sanitize(value.url));
+ node.setAttribute('width', value.width || '100%');
+ node.setAttribute('height', value.height || 'auto');
+ node.setAttribute('controls', value.controls || 'controls');
+ } else {
+ node.setAttribute('src', this.sanitize(value));
+ }
+
+ return node;
+ }
+
+ static formats(node) {
+ return ATTRIBUTES.reduce((formats, attribute) => {
+ if (node.hasAttribute(attribute)) {
+ formats[attribute] = node.getAttribute(attribute);
+ }
+ return formats;
+ }, {});
+ }
+
+ static sanitize(url) {
+ return Link.sanitize(url);
+ }
+
+ static value(node) {
+ return {
+ url: node.getAttribute('src'),
+ width: node.getAttribute('width'),
+ height: node.getAttribute('height'),
+ controls: node.getAttribute('controls'),
+ };
+ }
+
+ format(name, value) {
+ if (ATTRIBUTES.includes(name)) {
+ if (value) {
+ this.domNode.setAttribute(name, value);
+ } else {
+ this.domNode.removeAttribute(name);
+ }
+ } else {
+ super.format(name, value);
+ }
+ }
+}
+
+VideoBlot.blotName = 'video';
+VideoBlot.className = 'ql-video';
+VideoBlot.tagName = 'video';
+
+// 娣诲姞涓嶄細琚� sanitize 鐨勬爣璁�
+VideoBlot.sanitize = function(url) {
+ const sanitized = Link.sanitize(url);
+ return sanitized === Link.PROTOCOL_WHITELIST[0] ? 'about:blank' : sanitized;
+};
+
+export default VideoBlot;
diff --git a/manager/src/views/order/order/orderList.vue b/manager/src/views/order/order/orderList.vue
index 0b8c503..1bc82ef 100644
--- a/manager/src/views/order/order/orderList.vue
+++ b/manager/src/views/order/order/orderList.vue
@@ -292,6 +292,16 @@
width: 170,
},
{
+ title:"鏀惰揣浜�",
+ key:"consigneeName",
+ width: 170,
+ },
+ {
+ title:"鎵嬫満鍙�",
+ key:"consigneeMobile",
+ width: 170,
+ },
+ {
title: "鎿嶄綔",
key: "action",
align: "center",
@@ -312,6 +322,8 @@
);
},
},
+
+
],
data: [], // 琛ㄥ崟鏁版嵁
total: 0, // 琛ㄥ崟鏁版嵁鎬绘暟
diff --git a/manager/src/views/promotions/coupon/coupon-publish.vue b/manager/src/views/promotions/coupon/coupon-publish.vue
index 4bc3d80..ec34415 100644
--- a/manager/src/views/promotions/coupon/coupon-publish.vue
+++ b/manager/src/views/promotions/coupon/coupon-publish.vue
@@ -548,8 +548,10 @@
data.forEach((e) => {
e.id = e.skuId;
});
+
this.$refs.skuSelect.goodsData = data;
},
+
changeSelect(e) {
// 宸查�夊晢鍝佹壒閲忛�夋嫨
this.selectedGoods = e;
diff --git a/seller/src/views/login.vue b/seller/src/views/login.vue
index 62dfc6d..6f59077 100644
--- a/seller/src/views/login.vue
+++ b/seller/src/views/login.vue
@@ -21,28 +21,28 @@
<a @click="$router.push('forgetPassword')">蹇樿瀵嗙爜</a>
</div>
</Tab-pane>
- <Tab-pane label="楠岃瘉鐮佺櫥褰�" name="mobileLogin">
- <!-- 楠岃瘉鐮佺櫥褰� -->
- <Form ref="formSms" :model="formSms" :rules="ruleInline" @click.self='$refs.verify.show = false'>
- <FormItem prop="mobile">
- <i-input type="text" maxlength="11" v-model="formSms.mobile" clearable placeholder="鎵嬫満鍙�">
- <Icon type="md-lock" slot="prepend"></Icon>
- </i-input>
- </FormItem>
- <FormItem prop="code">
- <i-input type="text" v-model="formSms.code" placeholder="鎵嬫満楠岃瘉鐮�">
- <Icon type="ios-text-outline" style="font-weight: bold" slot="prepend" />
- <Button slot="append" @click="sendCode" :loading="sendCodeLoading">{{ codeMsg }}</Button>
- </i-input>
- </FormItem>
- <FormItem>
- <!-- <Button @click.stop="verifyBtnClick" long :type="verifyStatus ? 'success' : 'default'">{{ verifyStatus ?
- '楠岃瘉閫氳繃' :
- '鐐瑰嚮瀹屾垚瀹夊叏楠岃瘉' }}
- </Button> -->
- </FormItem>
- </Form>
- </Tab-pane>
+<!-- <Tab-pane label="楠岃瘉鐮佺櫥褰�" name="mobileLogin">-->
+<!-- <!– 楠岃瘉鐮佺櫥褰� –>-->
+<!-- <Form ref="formSms" :model="formSms" :rules="ruleInline" @click.self='$refs.verify.show = false'>-->
+<!-- <FormItem prop="mobile">-->
+<!-- <i-input type="text" maxlength="11" v-model="formSms.mobile" clearable placeholder="鎵嬫満鍙�">-->
+<!-- <Icon type="md-lock" slot="prepend"></Icon>-->
+<!-- </i-input>-->
+<!-- </FormItem>-->
+<!-- <FormItem prop="code">-->
+<!-- <i-input type="text" v-model="formSms.code" placeholder="鎵嬫満楠岃瘉鐮�">-->
+<!-- <Icon type="ios-text-outline" style="font-weight: bold" slot="prepend" />-->
+<!-- <Button slot="append" @click="sendCode" :loading="sendCodeLoading">{{ codeMsg }}</Button>-->
+<!-- </i-input>-->
+<!-- </FormItem>-->
+<!-- <FormItem>-->
+<!-- <!– <Button @click.stop="verifyBtnClick" long :type="verifyStatus ? 'success' : 'default'">{{ verifyStatus ?-->
+<!-- '楠岃瘉閫氳繃' :-->
+<!-- '鐐瑰嚮瀹屾垚瀹夊叏楠岃瘉' }}-->
+<!-- </Button> –>-->
+<!-- </FormItem>-->
+<!-- </Form>-->
+<!-- </Tab-pane>-->
</Tabs>
<Row>
<div class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long>
--
Gitblit v1.8.0