Commit 9dbcde0b by Jings

Merge remote-tracking branch 'origin/feature/九月迭代' into dev

parents b0df2600 2816e2ef
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-05-21 09:42:57
* @LastEditors: Drama
* @LastEditTime: 2022-09-08 18:01:24
-->
<!--
<text-edit :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></text-edit>
......@@ -19,11 +19,11 @@
</el-form-item>
<el-form-item label="内容" prop="materialContent">
<div class="material-content">
<el-input show-word-limit placeholder="请输入内容" type="textarea" v-model="ruleForm.materialContent" maxlength="1000" class="w-440 welcomeContent"></el-input>
<el-popover placement="top" width="388" trigger="click">
<el-input id="inputContent" show-word-limit placeholder="请输入内容" type="textarea" v-model="ruleForm.materialContent" maxlength="1000" class="w-440 welcomeContent"></el-input>
<el-popover placement="top" width="388" trigger="click" @show="showPopover('inputContent')">
<ul class="flex flex-wrap">
<li v-for="(item, index) in emojiList" :key="index + 'emoji'">
<img :src="item.gifUrl" alt="" @click="selectEmoji(item)" />
<img :src="item.gifUrl" alt="" @click.stop="selectEmoji(item)" />
</li>
</ul>
<img class="emoji-img cursor-pointer" slot="reference" src="https://pic01-10001430.image.myqcloud.com/b0d3c14f-69e7-4753-8fbc-3bffcff9f8ce" alt="" />
......@@ -76,11 +76,18 @@ export default {
materialTitle: [{ required: true, message: '请输入文本标题', trigger: 'blur' }],
materialContent: [{ required: true, message: '请输入文本内容', trigger: 'blur' }]
},
emojiList: emojiArr
emojiList: emojiArr,
ele: '' // dom元素id
};
},
methods: {
/**
* 获取dom
*/
showPopover(id) {
this.ele = id;
},
/**
* 输入内容
**/
handleInput($event) {
......@@ -92,7 +99,19 @@ export default {
**/
selectEmoji(item) {
const that = this;
const str = that.ruleForm.materialContent + item.key;
let textArea = document.getElementById(this.ele);
let startPos = textArea.selectionStart;
let endPos = textArea.selectionEnd;
if (startPos === undefined || endPos === undefined) return;
let currentTxt = textArea.value;
const str = currentTxt.substring(0, startPos) + item.key + currentTxt.substring(endPos);
// const str = that.ruleForm.materialContent + item.key;
textArea.value = str;
textArea.focus();
this.$nextTick(() => {
textArea.selectionStart = startPos + item.key.length;
textArea.selectionEnd = endPos + item.key.length;
});
if (str.length > 1000) {
this.$message('添加该表情后文本内容将超过字数限制,无法添加!');
} else {
......
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2020-12-14 16:54:50
* @LastEditors: Drama
* @LastEditTime: 2022-09-20 15:03:02
*/
import Vue from 'vue';
import Router from 'vue-router';
......@@ -119,7 +119,8 @@ export const constantRouterMap = [
{
path: '/guide-setting',
name: '导购设置',
component: _import('enterprise', 'guide-setting')
// component: _import('enterprise', 'guide-setting')
component: _import('enterprise', 'guide-setting-copy')
},
{
path: '/setting',
......@@ -168,6 +169,12 @@ export const constantRouterMap = [
name: '话务任务详情',
component: _import('salesleads/trafficTask', 'taskViewDetail')
},
// TODO: 导购视图
// {
// path: '/shopGuidView',
// name: '导购视图',
// component: _import('salesleads/trafficTask', 'shopGuidView')
// },
{
path: '/trafficTaskSet',
name: '话务任务设置',
......@@ -433,6 +440,8 @@ export const constantRouterMap = [
path: '/goodsShowSet',
name: '商品展示设置',
component: _import('apps/shoppingCenter', 'goodsShowSet')
// component: _import('apps/shoppingCenter', 'goodsShowSetCopy')
},
// 订单评价
{
......
......@@ -543,3 +543,51 @@ export function initDataRange() {
let startNewMonth = startMonth < 10 ? '0' + startMonth : startMonth;
return [`${startYear}-${startNewMonth}-${startDay}`, `${year}-${newMonth}-${day}`];
}
/**
* 将平铺的数据结构转为树形结构
* @param {*} list 数组
* @param {*} rootValue 根元素id
* @param {*} param2 可配置参数
* @returns
*/
export function arrToTree(list,rootValue,{idName = 'id',parentIdName = 'parentId',childName = 'children'}= {}) {
const objMap ={}; // 暂存数组以id为key的映射关系
const result = []; // 结果
for (const item of list) {
const id = item[idName];
const parentId = item[parentIdName];
// 该元素有可能已经放入map中(找不到该项的parent时会先放入map)
objMap[id] = !objMap[id] ? item : {...item,...objMap[id]}
const treeItem = objMap[id]; // 找到映射的那一项 引用
if(parentId === rootValue) {
// 根元素 将结果放入
result.push(treeItem)
} else {
// 若父元素不存在,初始化父元素
if(!objMap[parentId]) {
objMap[parentId] = {}
}
// 若无该跟元素则放入map中
if(!objMap[parentId][childName]) {
objMap[parentId][childName] = []
}
objMap[parentId][childName].push(treeItem)
}
}
return result
}
export function getArrDifference(arr1,arr2) {
let result = [];
arr1.forEach(item => {
if(arr1.includes(item) && !arr2.includes(item)) {
result.push(item)
}
})
return result;
}
\ No newline at end of file
......@@ -3,8 +3,8 @@
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-26 10:01:07
* @LastEditors: Drama
* @LastEditTime: 2022-09-19 10:09:46
-->
<!--
......@@ -27,7 +27,7 @@
</div>
<div>
<el-checkbox v-if="$getButtonLimit($buttonCode.groupExpire)" :limit-code="$buttonCode.groupExpire" v-model="overTimeSeeFlag" @change="saveGroupSet" :disabled="$store.state.wxEnterpriseType">
<el-tooltip class="item" effect="dark" content="开启后,GIC中设置的好办端会员分组失效后,即使在GIC开启好办展示,好办移动端也不再展示该条分组" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip>
<el-tooltip class="item" effect="dark" content="勾选后,失效的分组不在好办小程序端展示" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip>
</el-checkbox>
<el-button v-if="$getButtonLimit($buttonCode.syncGroup)" :limit-code="$buttonCode.syncGroup" type="primary" :loading="loadingBtn" @click="toSync" :disabled="$store.state.wxEnterpriseType">立即同步</el-button>
<span v-if="syncDate" class="font-14 color-606266 p-r-10">最近一次同步时间:{{ syncDate | formatTimeStamp }}</span>
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: Drama
* @LastEditTime: 2022-09-14 11:21:41
-->
<template>
<div class="app-detail-wrap">
<!-- <div class="app-detail-pane border-box p-20">
<div class="m-b-20">
<span class="font-14 p-r-10">商品展示:</span>
<el-checkbox v-model="myCustomData.salesGoodsFlag">已上架商品</el-checkbox><el-checkbox v-model="myCustomData.notSalesGoodsFlag">未上架商品</el-checkbox>
</div>
<div><el-switch v-model="myCustomData.showPriceFlag"></el-switch><span class="font-14 color-303133 p-l-10">商品详情屏蔽价格</span><span class="font-12 color-909399 p-l-10">注:开启后,商品列表及商品详情中会屏蔽价格字段。关闭后显示价格。</span></div>
<div class="m-t-46">
<el-button v-if="$getButtonLimit($buttonCode.saveGoodsSet)" :limit-code="$buttonCode.saveGoodsSet" type="primary" :loading="loading" @click="submit('searchFlag')" :disabled="$store.state.wxEnterpriseType">保 存</el-button>
</div>
</div> -->
<div class="p-l-40 border-box p-t-30">
<el-form v-model="myCustomData" label-width="130px">
<el-form-item label="商品展示"><el-checkbox v-model="myCustomData.salesGoodsFlag">已上架商品</el-checkbox><el-checkbox v-model="myCustomData.notSalesGoodsFlag">未上架商品</el-checkbox></el-form-item>
<el-form-item label="商品详情价格" prop="showPriceFlag">
<div class="setting-radio-item">
<el-radio v-model="myCustomData.showPriceFlag" :label="false">屏蔽</el-radio>
<div class="set-tip-txt">商品列表及商品详情中不显示价格字段</div>
</div>
<div class="setting-radio-item">
<el-radio v-model="myCustomData.showPriceFlag" :label="true">不屏蔽</el-radio>
<div class="set-tip-txt">商品列表及商品详情中显示价格字段</div>
</div>
</el-form-item>
<!-- TODO: 字段确定 -->
<el-form-item label="商品品类名称" prop="test">
<div class="setting-radio-item m-b-30">
<el-radio v-model="myCustomData.test" label="1">一级品类名称</el-radio>
<div v-show="myCustomData.test == 1" class="tip-fixed">好办小程序 [客户详情] - [消费记录]的消费衣橱商品将按照此设置划分</div>
</div>
<div class="setting-radio-item m-b-30">
<el-radio v-model="myCustomData.test" label="2">二级品类名称</el-radio>
<div v-show="myCustomData.test == 2" class="tip-fixed">好办小程序 [客户详情] - [消费记录]的消费衣橱商品将按照此设置划分</div>
</div>
<div class="setting-radio-item m-b-30">
<el-radio v-model="myCustomData.test" label="3">三级品类名称</el-radio>
<div v-show="myCustomData.test == 3" class="tip-fixed">好办小程序 [客户详情] - [消费记录]的消费衣橱商品将按照此设置划分</div>
</div>
</el-form-item>
</el-form>
</div>
<!-- TODO: save按钮 -->
<div class="fixed-save-btn border-box" v-if="$getButtonLimit($buttonCode.saveGoodsSet)">
<el-button :limit-code="$buttonCode.saveGoodsSet" type="primary" :loading="loading" @click="submit('searchFlag')" :disabled="$store.state.wxEnterpriseType">保存</el-button>
</div>
</div>
</template>
<script>
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
export default {
name: 'app-detail',
props: {
brandId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
projectName: '', // 当前项目名
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
myCustomData: {
salesGoodsFlag: false,
notSalesGoodsFlag: false,
showPriceFlag: false,
test: '1'
},
activeId: '1',
loading: false
};
},
methods: {
/**
* 保存
*/
submit: _debounce(function(type) {
const that = this;
that.loading = true;
that.setData(type);
}, 500),
/**
* 保存-API
*/
setData(type) {
const that = this;
let para = {
enterpriseId: that.brandId,
// wxEnterpriseRelatedId: that.wxEnterpriseRelatedId,
salesGoodsFlag: that.myCustomData.salesGoodsFlag ? 1 : '0',
notSalesGoodsFlag: that.myCustomData.notSalesGoodsFlag ? 1 : '0',
showPriceFlag: that.myCustomData.showPriceFlag ? 1 : '0'
};
console.log(para, 'para---');
const url = '/haoban-app-aggregation-web/save-goods-setting';
postRequest(url, para)
.then(res => {
let resData = res.data;
that.loading = false;
that.getCustomerSet();
if (resData.errorCode == 1) {
showMsg.showmsg('保存成功', 'success');
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取数据
*/
getCustomerSet(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
postRequest('/haoban-app-aggregation-web/find-goods-setting', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
if (!!resData.result) {
that.myCustomData.salesGoodsFlag = resData.result.salesGoodsFlag == 1 ? true : false;
that.myCustomData.notSalesGoodsFlag = resData.result.notSalesGoodsFlag == 1 ? true : false;
that.myCustomData.showPriceFlag = resData.result.showPriceFlag == 1 ? true : false;
}
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
brandId: function(newData, oldData) {
const that = this;
if (newData) {
that.getCustomerSet(that.brandId);
}
}
},
mounted() {
const that = this;
if (that.brandId) {
that.getCustomerSet(that.brandId);
}
},
components: {}
};
</script>
<style lang="scss" scoped>
.w-500 {
width: 500px;
}
.w-195 {
width: 195px;
}
.color-1890ff {
color: #2f54eb;
}
.p-20 {
padding: 20px;
}
.p-l-38 {
padding-left: 38px;
}
.p-l-199 {
padding-left: 199px;
}
.p-t-30 {
padding-top: 30px;
}
.m-b-30 {
margin-bottom: 30px;
}
.damolish .el-form-item {
margin-bottom: 30px;
}
.damolish .el-button {
padding: 8px 26px;
}
.app-detail-wrap {
height: 100%;
background: #fff;
.el-tabs {
background: #fff;
>>> .el-tabs__nav-wrap {
/* height: 48px;
line-height: 48px; */
&::after {
height: 1px;
}
/* .el-tabs__nav-scroll {
padding-left: 20px;
} */
}
}
.condition-tip {
width: 740px;
.el-alert--info {
background: #e6f7ff;
border: 1px solid rgba(145, 213, 255, 1);
.el-alert__icon {
font-size: 12px;
}
}
}
.setting-radio-item {
position: relative;
& + .setting-radio-item {
margin-top: 15px;
}
.set-tip-txt,
.tip-fixed {
padding: 0 0 0 25px;
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 15px;
}
.tip-fixed {
position: absolute;
top: 10;
}
}
.fixed-save-btn {
position: fixed;
display: flex;
-webkit-box-pack: center;
-webkit-box-align: center;
align-items: center;
justify-content: center;
bottom: 0;
width: calc(100% - 206px);
height: 56px;
background: #ffffff;
box-shadow: 1px -2px 8px 0px rgba(220, 223, 230, 0.6);
}
}
</style>
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