Browse Source

工作台权限

codeMan 1 year ago
parent
commit
eb4e352970

+ 22 - 1
cloud/businessCard/edit.vue

@@ -218,6 +218,18 @@ export default {
                     label: "自我介紹",
                     isMust: false,//是否必填
                     value: '',
+                },{
+                    key: "tag",
+                    type: "tag",
+                    label: "印象标签",
+                    isMust: false,//是否必填
+                    marginTop: 10,
+                    placeholder:'请填写,最多十个字',
+                    verify:[{
+                        reg: '^.{1,10}$',
+                        errText: "限制1-10字!"
+                    }],
+                    value: [],
                 },{
                     key: "attachmentids",
                     type: "upload",
@@ -269,6 +281,14 @@ export default {
             this.loading = true;
             let that = this;
             this.$refs.form.submit().then(data => {
+                this.$Http.basic({
+                    "id": 20220929090901,
+                    "content": {
+                        "ownertable": "sys_users",
+                        "ownerid": this.userid,
+                        "datatag": data.tag
+                    },
+                })
                 this.$Http.basic({
                     "id": 20240511151602,
                     "content": {
@@ -452,7 +472,8 @@ export default {
     box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
     box-sizing: border-box;
     padding: 5px 10px;
-
+    display: flex;
+    align-items: center;
     .add {
         display: flex;
         align-items: center;

+ 2 - 1
cloud/businessCard/index.vue

@@ -233,7 +233,7 @@ export default {
         width: 100vw;
         .bg-bottom {
             position: absolute;
-            bottom: 0px;
+            bottom: -1px;
             left: 0;
             width: 100vw;
 
@@ -516,6 +516,7 @@ export default {
     }
     .footer {
         display: flex;
+        align-items: center;
         position: fixed;
         bottom: 0;
         left: 0;

+ 291 - 2
cloud/commodityAdjustment/detail.vue

@@ -1,13 +1,302 @@
 <template>
     <view>
-        商品调整详情
+        <swiper class="swiper">
+            <swiper-item v-for="item in files" :key="item.attachmentid">
+                <u--image :src="item.cover" :lazy-load="true" width="100vw" :height="tovw(377)"
+                    @click.stop="previewImg(item.url)">
+                    <template v-slot:loading>
+                        <u-loading-icon color="red" />
+                    </template>
+                </u--image>
+            </swiper-item>
+        </swiper>
+
+        <view class="head">
+            <view class="name">{{ detail.name || '--' }}</view>
+            <text class="model u-line-1" v-if="detail.model">型号:{{ detail.model }}</text>
+            <text class="subtitle u-line-1" v-if="detail.subtitle">{{detail.subtitle}}</text>
+        </view>
+
+        <!-- <text class="descript">注:价格不能超过4000元/台</text> -->
+        <view class="price-content">
+            <view class="item-box">
+                <text class="price-label">付款方式:</text>
+                <u-radio-group v-model="detail.pricetype"
+                    @change="init()">
+                    <u-radio :customStyle="{marginRight:tovw(50)}" key="一口价" label="一口价" name="一口价" />
+                    <u-radio :customStyle="{}" key="阶梯价" label="阶梯价" name="阶梯价" />
+                </u-radio-group>
+            </view>
+            <AForm ref="form" :form="form" @isUncomplete="isUncomplete"></AForm>
+            <view style="height: 70px;" />
+        </view>
+        
+        <view class="footer">
+            <view class="add" :class="uncomplete ? 'forbidden' : ''" hover-class="navigator-hover"
+                @click="uncomplete || loading ? '' : submit()">
+                <u-loading-icon v-if="loading" />
+                <block v-else>
+                    {{  '保存' }}
+                </block>
+            </view>
+        </view>
     </view>
 </template>
 
 <script>
+import AForm from '../../components/my_form2.vue'
+import { viewImage, formattedFiles } from "../../utils/settleFiles"
 export default {
+    components:{AForm},
+    data () {
+        return {
+            files:[],
+            detail: {
+                sa_fadid:'',
+            },
+            form:[],
+            uncomplete:false,
+            loading:false,
+        }
+    },
+    onLoad (options) {
+        this.detail.sa_fadid = options.id
+        this.getDetail()
+    },
+    methods: {
+        isUncomplete(uncomplete,actions) {
+            console.log(uncomplete,'验证');
+            this.uncomplete = uncomplete;
+        },
+        submit() {
+            this.loading = true;
+            let that = this;
+            // let is = this.$refs.form.list.some(v=> {
+            //     if (v.inputmode == 'digit' && v.value > 4000) {
+            //         uni.showToast({
+            //             title:'价格<=4000元'
+            //         })
+            //         return true
+            //     } else {
+            //         false
+            //     }
+            // })
+            // if (is) return this.loading = false
+            this.$refs.form.submit().then(data => {
+                let form = Object.assign({},that.detail,data)
+                this.$Http.basic({
+                    "id": 20240428154102,
+                    "content": form
+                }).then(async res => {
+                    this.loading = false;
+                    console.log("修改信息", res)
+                    if (this.cutoff(res.msg)) return;
+                    that.getDetail()
+                    uni.showToast({
+                        title:'修改成功'
+                    })
+                    this.$Http.editProduct()
+                    setTimeout(() => {
+                        uni.navigateBack()
+                    },400)
+                })
+            })
+        },
+        previewImg(url) {
+            viewImage(url)
+        },
+        getDetail() {
+            this.$Http.basic({
+                "id": "20240428154202",
+                "content": {
+                    "sa_fadid": this.detail.sa_fadid
+                }
+            }).then(res => {
+                if (this.cutoff(res.msg)) return;
+                this.files = formattedFiles(res.data.attinfos_pic.map(v => v.attinfos[0])).map((v, i) => {
+                    if (v.fileType == 'image') v.cover = this.getSpecifiedImage(v, 'compressed')
+                    if (i == 0) res.data.cover = v.cover;
+                    return v
+                })
+                this.detail = res.data;
+                this.detail.isonsale = this.detail.isonsale+''
+                this.init()
+                console.log(this.files,this.detail,'数据');
+                uni.setNavigationBarTitle({
+                    title: '编辑商品'
+                });
+            })
+
+        },
+        async init () {
+            let form
+            if (this.detail.pricetype == '一口价') {
+                form = [{
+                    key: "price",
+                    type: "text",
+                    inputmode:'digit',
+                    label: "价格(元/",
+                    isMust: true,//是否必填
+                    value: "",
+                    descript:'官方指导价:',
+                },{
+                    key: "tag",
+                    type: "text",
+                    inputmode:'text',
+                    label: "标签",
+                    isMust: false,//是否必填
+                    value: "",
+                    paddingBottom:15,
+                    borderRadius:true,
+                    descript:'官方建议:'
+                },{
+                    key: "isonsale",
+                    type: "radio",
+                    options:[{label:'上架',name:'1',marginRight:50},{label:'下架',name:'0'}],
+                    label: "状态",
+                    isMust: true,//是否必填
+                    value: "",
+                }]
+            } else {
+                form = [{
+                    key: "price_rebate",
+                    type: "text",
+                    inputmode:'digit',
+                    label: "总部返利价(元/",
+                    isMust: true,//是否必填
+                    value: "",
+                    descript:'官方指导价:',
+                },{
+                    key: "price_original",
+                    type: "text",
+                    inputmode:'digit',
+                    label: "原价(元/",
+                    isMust: true,//是否必填
+                    value: "",
+                    paddingBottom:15,
+                    descript:'官方指导价:',
+                },{
+                    key: "price_store",
+                    type: "text",
+                    inputmode:'digit',
+                    label: "店面最低价(元/",
+                    isMust: true,//是否必填
+                    value: "",
+                    paddingBottom:15,
+                    descript:'官方指导价:',
+                },{
+                    key: "price_deposit",
+                    type: "text",
+                    inputmode:'digit',
+                    label: "定金(元/",
+                    isMust: true,//是否必填
+                    value: "",
+                    paddingBottom:15,
+                    descript:'官方指导价:',
+                },{
+                    key: "isonsale",
+                    type: "radio",
+                    options:[{label:'上架',name:'1',marginRight:50},{label:'下架',name:'0'}],
+                    label: "状态",
+                    isMust: true,//是否必填
+                    value: "",
+                }]
+            }
+            
+            form = form.map(v => {
+                if (v.key == 'tag') v.descript = v.descript + this.detail.officialinfo[v.key]
+                if (v.key != 'isonsale' && v.key != 'tag') {
+                    v.descript = v.descript + this.detail.officialinfo[v.key]
+                    v.label = v.label + this.detail.unitname + ')'
+                }
+                v.value = this.detail[v.key] || v.value
+                return v
+            })
+            this.form = form
+            console.log(this.form,'value');
 
+        },
+    },
 }
 </script>
 
-<style></style>
+<style lang="scss">
+.swiper {
+    width: 100vw;
+    height: 377px;
+}
+.descript {
+    font-weight: 400;
+    font-size: 14px;
+    color: #E3041F;
+    padding-left: 10px;
+}
+.price-content {
+    background: #ffffff;
+    margin-top: 10px;
+    .item-box {
+        display: flex;
+        align-content: center;
+        align-items: center;
+        padding: 15px 0 0 10px;
+        .price-label {
+            margin-right: 10px;
+            color: #666666;
+        }
+    }
+}
+.head {
+    position: relative;
+    background: #fff;
+    padding: 10px;
+    box-sizing: border-box;
+    margin-bottom: 10px;
+    .name {
+        width: 280px;
+        height: 24px;
+        line-height: 24px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-weight: bold;
+        font-size: 16px;
+        color: #333333;
+        margin-bottom: 10px;
+    }
+    text {
+        font-weight: 400;
+        font-size: 12px;
+        color: #999999;
+    }
+    .model {
+        margin-bottom: 5px;
+    }
+}
+.footer {
+    position: fixed;
+    bottom: 0;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    box-sizing: border-box;
+    padding: 5px 10px;
+    z-index: 5;
+    display: flex;
+    align-items: center;
+    .add {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 100%;
+        height: 45px;
+        background: #C30D23;
+        border-radius: 5px;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 14px;
+        color: #FFFFFF;
+    }
+
+    .forbidden {
+        opacity: .6;
+    }
+}
+</style>

+ 140 - 4
cloud/commodityAdjustment/index.vue

@@ -1,13 +1,149 @@
 <template>
-    <view>
-        商品调整列表
+    <view class="product">
+        <view style="padding: 10px;background: #ffffff;">
+            <My_search placeholder="搜索名称" @onSearch="onSearch"></My_search>
+            <view class="tabs-box" v-if="typeList.length">
+                <v-tabs ref="tabs" v-model="tabsActive" field="remarks" :pills="true" height="24px" pillsBorderRadius="12px"
+                    pillsColor="#C30D23" pillsUnColor="#eee" bgColor="none" itemMargin="0 4px 0 0" color="#333333"
+                    activeColor="#FFFFFF" :tabs="typeList" @change="changeClass" />
+            </view>
+        </view>
+        <view class="header-line">
+            <text>商品</text>
+            <text>共{{total}}个</text>
+        </view>
+        <view class="list">
+            <My_listbox ref="List" @getlist="getList" :bottomHeight="70">
+                <navigator @click="goDetail" :url="'/cloud/commodityAdjustment/detail?id='+item.sa_fadid" class="product-item" v-for="item in list" :key="item.sa_fadid">
+                    <u-image :src="item.attinfos.length ? item.attinfos[0].url:''" :width="tovw(86)" :height="tovw(80)" :lazy-load="true" radius="5"></u-image>
+                    <view class="product-info">
+                        <text class="title u-line-1">{{ item.name }}</text>
+                        <text class="price"><text style="margin-right: 2px;">¥</text>{{ CNY(item.pricetype != '阶梯价' ? item.price : item.price_deposit,'') }}<text style="margin-left: 2px;">元</text></text>
+                    </view>
+                </navigator>
+            </My_listbox>
+        </view>
     </view>
 </template>
 
 <script>
 export default {
-
+    data () {
+        return {
+            list:[],
+            content: {
+                "sys_enterpriseid": uni.getStorageSync('shop').sys_enterpriseid, //门店信息中获取
+                "pageNumber": 1,
+                "pageSize": 20,
+                "where": {
+                    "condition": "",
+                    "class": ""
+                }
+            },
+            typeList:[],
+            tabsActive: 0,
+            total:0
+        }
+    },
+    methods: {
+        goDetail () {
+            this.$Http.editProduct = function (id){
+                this.getList (true)
+                delete this.$Http.editProduct
+            }.bind(this)
+        },
+        onSearch (condition) {
+            this.content.where.condition = condition
+            this.getList(true)
+        },
+        changeClass(index) {
+            this.tabsActive = index;
+            this.content.where.class = this.typeList[index].value;
+            this.getList(true);
+        },
+        getList(init = false) {
+            return new Promise((resolve, reject) => {
+                if (this.paging(this.content, init)) return resolve();
+                this.$Http.basic({
+                    "id": "20240515153202",
+                    content: this.content
+                }).then(res => {
+                    this.total = res.total
+                    this.$refs.List.setHeight()
+                    this.$refs.List.RefreshToComplete()
+                    resolve();
+                    if (this.cutoff(res.msg)) return;
+                    this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
+                    console.log("获取商品列表", this.list)
+                    this.content = this.$refs.List.paging(this.content, res)
+                })
+            })
+        },
+        async getType () {
+            this.getCustomClass("goodstype").then(list => {
+                console.log("分类列表", list)
+                this.typeList = list;
+                this.typeList.unshift({remarks:'全部',value:''})
+                this.getList()
+            })
+        },
+        onLoad () {
+            uni.setNavigationBarTitle({
+                title:'商品调整',
+            })
+            this.getType()
+        }
+    },
 }
 </script>
 
-<style></style>
+<style lang="scss">
+.product {
+    box-sizing: border-box;
+    font-family: Source Han Sans SC, Source Han Sans SC;
+    .tabs-box {
+        margin-top: 10px;
+    }
+    .header-line {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        align-content: center;
+        padding: 10px;
+        font-weight: 400;
+        font-size: 12px;
+        color: #666666;
+    }
+    .list {
+        .product-item {
+            padding: 12px 10px;
+            display: flex;
+            align-items: center;
+            align-content: center;
+            background: #ffffff;
+            margin-bottom: 10px;
+            .product-info {
+                flex: 1;
+                margin-left: 20px;
+                display: flex;
+                flex-direction: column;
+                .title {
+                    margin-bottom: 10px;
+                    font-weight: bold;
+                    font-size: 16px;
+                    color: #333333;
+                }
+                .price {
+                    font-weight: bold;
+                    font-size: 18px;
+                    color: #E3041F;
+                    text {
+                        font-weight: none;
+                        font-size: 12px;
+                    }
+                }
+            }
+        }
+    }
+}
+</style>

+ 112 - 0
components/my_form.vue

@@ -212,6 +212,31 @@
                         </view>
                     </view>
                 </view>
+                <!-- 标签 -->
+                <view class="tag-box custom-class-box " v-else-if="item.type == 'tag'"
+                    :style="{ marginTop: tovw(item.marginTop || 0) }">
+                        <text class="label">{{ item.label }}</text>
+                        <view class="tag-list">
+                            <view class="tag" v-for="tag in item.value" :key="tag">
+                                <text>{{tag}}</text>
+                                <view @click="delTag(tag,index)" class="del">x</view>
+                            </view>
+                            <view>
+                                <u-modal :title="item.label" :show="showTagModal" style="flex: 0 !important;" confirmColor='#C30D23' ref="uModal" showCancelButton :asyncClose="false"
+                                    @confirm="addTagSend(index)" @cancel="showTagModal = false">
+                                    <view class="slot-content">
+                                        <view v-if="item.errText" class="err-text" style="margin-bottom: 10px;">
+                                            <icon class="icon" color="#E3041F" type="clear" size="2.733vw" />
+                                            {{ item.errText }}
+                                        </view>
+                                        <u--input :focus="showUModal" @input="onTagInput($event, index)" :placeholder="item.placeholder || '请输入'" v-model="tagValue" border="bottom" clearable />
+                                    </view>
+                                </u-modal>
+                                <view class="add-tag" @click="showTagModal=true">+ 添加</view>
+                            </view>
+                            
+                        </view>
+                </view>
             </block>
         </block>
     </view>
@@ -248,6 +273,8 @@ export default {
             list: [],
             focusLabel: "",
             unShowAll: false,
+            showTagModal:false,
+            tagValue:''
         }
     },
     watch: {
@@ -322,6 +349,21 @@ export default {
             }] */
     },
     methods: {
+        delTag (tag,index) {
+            let item = this.list[index];
+            console.log(tag);
+            item.value.splice(item.value.indexOf(tag),1)
+            this.$set(this.list[index], 'value', item.value)
+        },
+        addTagSend (index) {
+            let item = this.list[index]
+            if (!item.errText) {
+                item.value.push(this.tagValue)
+                this.$set(this.list[index], 'value', item.value)
+                this.tagValue = ''
+                this.showTagModal = false
+            }
+        },
         toRoute(item, index) {
             uni.navigateTo({
                 url: item.path
@@ -331,6 +373,15 @@ export default {
                 delete this.$Http.routeSelected;
             }.bind(this)
         },
+        onTagInput(e, index) {
+            let item = this.list[index];
+            item.errText = "";
+            if (item.verify && item.verify.length && this.tagValue != '') {
+                let err = item.verify.find(r => !new RegExp(r.reg).test(this.tagValue));
+                if (err) this.$set(this.list[index], 'errText', err.errText)
+            }
+            this.verify()
+        },
         onInput(e, index) {
             let item = this.list[index];
             item.errText = "";
@@ -779,6 +830,67 @@ export default {
         }
     }
 
+}
+.tag-box {
+    .label {
+        width: 100px;
+        margin-right: 10px;
+        line-height: 20px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 14px;
+        color: #666666;
+        flex-shrink: 0;
+        .must {
+            color: #E3041F;
+            margin-right: 5px;
+        }
+    }
+    .tag-list{
+        display: flex;
+        align-content: center;
+        align-items: center;
+        flex-wrap: wrap;
+        font-family: PingFang SC, PingFang SC;
+        margin-top:10px;
+        .err-text {
+            font-size: 12px;
+            color: #E3041F;
+            margin-bottom: -12px;
 
+            .icon {
+                margin-right: 2px;
+            }
+        }
+        .tag {
+            padding: 6px 10px;
+            background: #F2F2F2;
+            border-radius: 5px 5px 5px 5px;
+            margin-right: 10px;
+            margin-bottom: 10px;
+            font-weight: 400;
+            font-size: 14px;
+            color: #333333;
+            display: flex;
+            align-items: center;
+            align-content: center;
+            text-align:center;
+            &:last-child {
+                margin-right: 0 !important;
+            }
+            .del {
+                margin-left: 10px;
+                padding: 2px;
+            }
+        }
+        .add-tag {
+            border-radius: 5px 5px 5px 5px;
+            border: 1px dashed #C30D23;
+            padding: 6px 20px;
+            color:#C30D23;
+            font-weight: 400;
+            margin-bottom:10px;
+            font-size: 14px;
+        }
+    }
 }
 </style>

+ 6 - 325
store/budget/my_form.vue → components/my_form2.vue

@@ -54,133 +54,6 @@
                         </view>
                     </view>
                 </view>
-                <!-- 文本域 -->
-                <view class="textarea-box" v-else-if="item.type == 'textarea'">
-                    <textarea class="textarea" :class="item.unBorBot ? '' : 'borBot'" :disabled="item.disabled"
-                        placeholder-style="color: #BBBBBB;font-family: Source Han Sans SC, Source Han Sans SC;" type="text"
-                        :placeholder="item.placeholder || '请填写' + item.label" :value="item.value"
-                        @input="onInput($event, index)" :maxlength="item.maxlength || '499'" confirm-type="done" />
-                </view>
-                <!-- 自定义选项分类 -->
-                <view class="custom-class-box" v-else-if="item.type == 'customClass'"
-                    :style="{ marginTop: tovw(item.marginTop || 0) }">
-                    <view class="head">
-                        <view class="label">
-                            <text class="must" style="color: #E3041F;" v-if="item.isMust">*</text>
-                            {{ item.label }}
-                        </view>
-                        <view class="state">
-                            {{ item.isMultipleChoice ? '可多选' : '仅单选' }}
-                        </view>
-                    </view>
-                    <view class="options">
-                        <view class="option"
-                            :class="item.isMultipleChoice ? (item.value.includes(option.value) ? 'active' : '') : (item.value == option.value ? 'active' : '')"
-                            v-for=" option  in  item.list " :key="option.value" hover-class="navigator-hover"
-                            @click="changOptions(option.value, index)">
-                            {{ option.remarks }}
-                        </view>
-                    </view>
-                </view>
-                <!-- 选择所在地区 -->
-                <picker class="region" @change="selectRegion($event, index)" mode='region' :disabled="item.disabled"
-                    :value="item.value" v-else-if="item.type == 'region'"
-                    :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
-                    <view class="box" :class="item.unBorBot ? '' : 'borBot'">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}:
-                        </view>
-                        <view class="content-box">
-                            <view class="value" v-if="item.value.length">
-                                {{ item.value.join(",") }}
-                            </view>
-                            <view v-else class="placeholder" hover-class="none">
-                                {{ item.placeholder || '请选择' + item.label }}
-                            </view>
-                            <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
-                        </view>
-                    </view>
-                </picker>
-                <!-- 日期 -->
-                <picker class="region" @change="selectRegion($event, index)" mode='date' :disabled="item.disabled"
-                    :value="item.value" v-else-if="item.type == 'date'"
-                    :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }">
-                    <view class="box" :class="item.unBorBot ? '' : 'borBot'">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}:
-                        </view>
-                        <view class="content-box">
-                            <view class="value" v-if="item.value">
-                                {{ item.value }}
-                            </view>
-                            <view v-else class="placeholder" hover-class="none">
-                                {{ item.placeholder || '请选择' + item.label }}
-                            </view>
-                            <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
-                        </view>
-                    </view>
-                </picker>
-                <!-- 上传附件 -->
-                <view class="custom-class-box" v-else-if="item.type == 'upload'"
-                    :style="{ marginTop: tovw(item.marginTop || 0) }">
-                    <view class="head">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}
-                        </view>
-                        <view class="state">
-                            {{ item.placeholder }}
-                        </view>
-                    </view>
-                    <view class="content">
-                        <view class="file-box" v-for="file in item.value" :key="file.attachmentid">
-                            <image class="image" v-if="file.fileType == 'image'" :src="file.url" mode="aspectFill"
-                                lazy-load="true" @click="previewImg(file)" />
-                            <video v-else-if="file.fileType == 'video'" class="video" :poster="file.subfiles[0].url"
-                                :src="file.url" />
-                            <image class="delete" @click.stop="deleteFile(file, index)"
-                                src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202404241713944430197B47af9b2f.png"
-                                mode="widthFix" />
-                        </view>
-                        <My_upload v-if="item.allowUpload" :showLoading="false" :accept="item.accept"
-                            @uploadCallback="uploadCallback($event, index)" @onLoading="onUploadLoading($event, index)">
-                            <view class="upload-box" hover-class="navigator-hover">
-                                <u-loading-icon v-if="item.loading" />
-                                <text v-else class="iconfont icon-xiazai" />
-                                <text style="margin-left: 5px;">上传</text>
-                            </view>
-                        </My_upload>
-                    </view>
-                </view>
-                <!-- 开关 -->
-                <view class="region" v-else-if="item.type == 'switch'">
-                    <view class="box" :class="item.unBorBot ? '' : 'borBot'">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}:
-                        </view>
-                        <view class="content-box">
-                            <view />
-                            <u-switch activeColor="#70D95D" v-model="item.value" :disabled="item.disabled"
-                                @change="switchChange($event, index)" />
-                        </view>
-                    </view>
-                </view>
-                <!-- 性别 -->
-                <view class="region" v-else-if="item.type == 'sex'">
-                    <view class="box" :class="item.unBorBot ? '' : 'borBot'">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}:
-                        </view>
-                        <u-radio-group v-model="item.value" placement="row" @change="groupChange($event, index)">
-                            <u-radio :customStyle="{ marginRight: tovw(60) }" label="男" name="男" />
-                            <u-radio label="女" name="女" />
-                        </u-radio-group>
-                    </view>
-                </view>
                 <!-- 单选 -->
                 <view class="region" v-else-if="item.type == 'radio'">
                     <view class="box" :class="item.unBorBot ? '' : 'borBot'">
@@ -196,33 +69,13 @@
                         </u-radio-group>
                     </view>
                 </view>
-                <!-- 路由选择器 -->
-                <view class="region" v-else-if="item.type == 'route'"
-                    :style="{ marginTop: tovw(item.marginTop || 0), opacity: item.disabled ? 0.7 : 1 }"
-                    @click="item.disabled ? '' : toRoute(item, index)">
-                    <view class="box" :class="item.unBorBot ? '' : 'borBot'">
-                        <view class="label">
-                            <text class="must" v-if="item.isMust">*</text>
-                            {{ item.label }}:
-                        </view>
-                        <view class="content-box">
-                            <view class="value" v-if="item.value.length">
-                                {{ item.showValue.join(",") }}
-                            </view>
-                            <view v-else class="placeholder" hover-class="none">
-                                {{ item.placeholder || '请选择' + item.label }}
-                            </view>
-                            <view v-if="!item.disabled" class="iconfont icon-a-wodetiaozhuan" />
-                        </view>
-                    </view>
-                </view>
             </block>
         </view>
     </view>
 </template>
 
 <script>
-import { formattedFiles, viewImage } from "../../utils/settleFiles.js"
+import { formattedFiles, viewImage } from "../utils/settleFiles.js"
 
 export default {
     name: "my_form",
@@ -271,70 +124,8 @@ export default {
         }
     },
     async created() {
-        /*     let list = [{
-                key: "name",
-                type: "text",
-                label: "标题",
-                isMust: true,//是否必填
-                value: "",
-                inputmode:"", //https://uniapp.dcloud.net.cn/component/input.html#type
-                marginTop: 10,
-                verify:[],
-            }, {
-                key: "Class",
-                type: "customClass",
-                label: "标题",
-                isMust: false,//是否必填
-                isMultipleChoice: true,//是否多选
-                value: [],// 多选[] 单选 ""
-                isMust: true,//是否必填
-                list: await this.getCustomClass('picturespace'),
-                marginTop: 10
-            },{
-                key: "attachmentids",
-                type: "upload",
-                label: "图片/视频",
-                accept:"all",
-                placeholder: "可上传多个视频或图片",
-                ownertable: "temporary",
-                ownerid: 999,
-                usetype: 'default',
-                allowUpload: true,
-                allowDelete: true,
-                value:[],
-                marginTop: 10
-            }, {
-                key: "region",
-                type: "region",
-                label: "所在地区",
-                isMust: true,//是否必填
-                value: [],
-            }, {
-                key: "address",
-                type: "textarea",
-                label: "详细地址",
-                isMust: true,//是否必填
-                value: '',
-            }, {
-                key: "isdefault",
-                type: "switch",
-                label: "设为默认地址",
-                isMust: false,//是否必填
-                value: false,
-                isNum: true,
-                unBorBot: true
-            }] */
     },
     methods: {
-        toRoute(item, index) {
-            uni.navigateTo({
-                url: item.path
-            });
-            this.$Http.routeSelected = function (selected) {
-                this.$emit('interrupt', item, selected, index)
-                delete this.$Http.routeSelected;
-            }.bind(this)
-        },
         onInput(e, index) {
             let item = this.list[index];
             item.errText = "";
@@ -365,25 +156,6 @@ export default {
             this.$set(this.list[index], 'value', e)
             this.verify()
         },
-        changOptions(value, index) {
-            let item = this.list[index];
-            if (item.isMultipleChoice) {
-                let i = -1;
-                try {
-                    i = item.value.findIndex(v => v == value)
-                } catch (error) {
-                }
-                if (i == -1) {
-                    item.value.push(value)
-                } else {
-                    item.value.splice(i, 1)
-                }
-                this.$set(this.list[index], 'value', item.value)
-            } else {
-                this.$set(this.list[index], 'value', value)
-            }
-            this.verify()
-        },
         verify() {
             let list = this.list.filter(v => v.isMust);
             let Uncomplete = false;
@@ -411,89 +183,6 @@ export default {
         previewImg(item) {
             viewImage(item.url)
         },
-        uploadCallback(attachmentids, index) {
-            let item = this.list[index];
-            this.$Http.basic({
-                "classname": "system.attachment.Attachment",
-                "method": "createFileLink",
-                "content": {
-                    ownertable: item.ownertable,
-                    ownerid: item.ownerid,
-                    usetype: item.usetype,
-                    attachmentids
-                }
-            }).then(res => {
-                console.log('绑定附件', res)
-                if (this.cutoff(res.msg)) return;
-                res.data = formattedFiles(res.data)
-                item.value.push(res.data[0]);
-
-                //临时文件
-                if (res.data[0].ownertable == "temporary") try {
-                    item.temporarys.push(attachmentids[0])
-                } catch (error) {
-                    item.temporarys = [attachmentids[0]]
-                }
-
-                this.$set(this.list[index], 'value', item.value)
-                this.verify()
-            })
-        },
-        deleteFiles() {
-            this.list.forEach(v => {
-                if (v.type == 'upload') {
-                    let linksids = v.value.filter(v => v.ownertable == "temporary").map(v => v.linksid)
-                    if (linksids.length) this.$Http.basic({
-                        "classname": "system.attachment.Attachment",
-                        "method": "deleteFileLink",
-                        "content": {
-                            linksids
-                        }
-                    }).then(res => {
-                        console.log("处理删除附件", res)
-                        if (this.cutoff(res.msg)) return;
-                    });
-                }
-            });
-        },
-        onUploadLoading(e, index) {
-            this.$set(this.list[index], 'loading', e)
-            this.$emit("onUploading", e)
-        },
-        groupChange(e, index) {
-            this.$set(this.list[index], 'loading', e)
-            this.verify()
-        },
-        selectRegion({ detail }, index) {
-            this.$set(this.list[index], 'value', detail.value)
-            this.verify()
-        },
-        deleteFile(flie, index) {
-            let item = this.list[index];
-            item.value = item.value.filter(v => v.attachmentid != flie.attachmentid)
-            //临时文件
-            if (flie.ownertable == "temporary") {
-                item.temporarys = item.temporarys.filter(v => v != flie.attachmentid)
-                this.$Http.basic({
-                    "classname": "system.attachment.Attachment",
-                    "method": "deleteFileLink",
-                    "content": {
-                        linksids: [flie.linksid]
-                    }
-                }).then(res => {
-                    console.log("处理删除附件", res)
-                    if (this.cutoff(res.msg)) return;
-                });
-            } else {
-                try {
-                    item.linksids.push(flie.linksid)
-                } catch (error) {
-                    item.linksids = [flie.linksid]
-                }
-            }
-            this.$set(this.list[index], 'value', item.value)
-            this.verify()
-        },
         submit() {
             return new Promise((resolve, reject) => {
                 let res = {};
@@ -667,17 +356,6 @@ export default {
     }
 }
 
-.textarea-box {
-    width: 100%;
-
-    .textarea {
-        width: 355px;
-        height: 160px;
-        padding: 15px 10px;
-        box-sizing: border-box;
-        margin: 0 auto;
-    }
-}
 
 .input-box {
     width: 100%;
@@ -742,14 +420,17 @@ export default {
             align-items: center;
             box-sizing: border-box;
             position: relative;
-            input {
+            input,textarea {
                 width: 100%;
-                height: 50px;
+                height: 50px !important;
                 background: #F7F7F7;
                 border-radius: 8px 8px 8px 8px;
                 border: 1px solid #DDDDDD;
                 padding-left: 10px;
             }
+            textarea {
+                line-height: 50px;
+            }
 
             .icon {
                 padding: 5px;

+ 33 - 111
pages/index/cloud/workbench.vue

@@ -17,11 +17,11 @@
         </view>
         <view class="work-panel_applist"> 
             <template v-for="(item,index) in list">
-                <navigator class="app" :url="item.path" :key="index" v-if="item.path">
+                <navigator @click="switchPage(item)" class="app" url="#" :key="item.name">
                     <view class="bg" :style="item.color">
-                        <image class="image" :src="`/static/workbench/${item.label}.svg`" mode="widthFix"></image>
+                        <image class="image" :src="`/static/workbench/${item.name}.svg`" mode="widthFix"></image>
                     </view>
-                    <text class="name">{{item.label}}</text>
+                    <text class="name">{{item.remark}}</text>
                     
                 </navigator>
             </template>
@@ -29,12 +29,10 @@
         </view>
         <view class="work-panel_options">
             <template v-for="(item,index) in list2">
-                <navigator class="option" :key="index" :url="item.path" hover-class="navigator-hover" open-type="navigate" v-if="item.path">
+                <navigator @click="switchPage(item)" class="option" :key="index" url="#" hover-class="navigator-hover" open-type="navigate">
                     <view class="box">
-                        <text class="left">{{ item.label }}</text>
+                        <text class="left">{{ item.remark }}</text>
                         <view class="right">
-                            <!-- <view class="tag">10</view> -->
-                            
                             <u-icon name="arrow-right" color="#999999"></u-icon>
                         </view>
                     </view>
@@ -52,85 +50,8 @@ export default {
     data() {
         return {
             updatePage: true,
-            list: [{
-                label: "预约名单",
-                itemId: "cloud",
-                name:'orderList'
-            }, {
-                label: "企业公告",
-                itemId: "index",
-                page: "活动",
-                name:'1'
-            }, {
-                label: "设计实景",
-                itemId: "index",
-                page: "案例",
-                params: {
-                    active: '图库'
-                },
-                name:'1'
-            }, {
-                label: "商城订单",
-                itemId: "index",
-                page: "案例",
-                params: {
-                    active: '实景案例'
-                },
-                name:'1'
-            }, {
-                label: "订单提报",
-                itemId: "cloud",
-                name:'1'
-            }, {
-                label: "团队管理",
-                itemId: "cloud",
-            }, {
-                label: "商品调整",
-                name:'1'
-            }, {
-                label: "直播管理",
-                name:'1'
-            }, {
-                label: "品质服务管理",
-                name:'1'
-            }, {
-                label: "装修预算改价",
-                name:"budget",
-            }],
-            list2: [{
-                label: "我的访问店铺",
-                itemId: "cloud",
-                name:'1'
-            }, {
-                label: "我的预约",
-                itemId: "index",
-                page: "活动",
-                name:'selfOrder',
-            }, {
-                label: "收货地址",
-                itemId: "index",
-                page: "案例",
-                name:'1',
-            }, {
-                label: "我的收藏",
-                itemId: "index",
-                page: "案例",
-                name:'1',
-            }, {
-                label: "通讯录",
-                itemId: "cloud",
-                name:'contacts',
-            }, {
-                label: "考试成绩",
-                itemId: "cloud",
-                name:'1',
-            }, {
-                label: "问卷调查",
-                name:'1',
-            }, {
-                label: "意见反馈",
-                name:'1',
-            }],
+            list: [],
+            list2: [],
             colors: ['background: linear-gradient( 225deg, #81AEF3 0%, #6787E7 100%)',
                 "background: linear-gradient( 225deg, #F1AA68 0%, #EA895B 100%)",
                 "background: linear-gradient( 225deg, #EEA6A4 0%, #E0605A 100%)",
@@ -156,12 +77,13 @@ export default {
         }
     },
     methods: {
+        
         init(callBack) {
             callBack()
+            this.list = Object.values(uni.getStorageSync('authList').工作台)
+            this.list2 = Object.values(uni.getStorageSync('authList').工作台导航)
             this.list = this.dye(this.list, this.colors, 1)
             this.getUserInfo()
-            this.handleAppRole()
-            console.log(this.list,'应用');
             this.updatePage = false;
         },
         async getUserInfo () {
@@ -172,31 +94,31 @@ export default {
             this.userInfoValue = res.data
             console.log(this.userInfoValue,'用户信息')
         },
-        //处理权限
-        handleAppRole () {
-            this.roles = uni.getStorageSync("authList")
-            let keys = Object.keys(this.roles.工作台)
-            for (let index = 0; index < this.list.length; index++) {
-                for (let index2 = 0; index2 < keys.length; index2++) {
-                    if (this.roles.工作台[keys[index2]] && this.roles.工作台[keys[index2]].name == this.list[index].name) {
-                        this.list[index] = Object.assign({},this.list[index],this.roles.工作台[keys[index2]])
-                        break;
-                    }
-                }
-            }
+        // //处理权限
+        // handleAppRole () {
+        //     this.roles = uni.getStorageSync("authList")
+        //     let keys = Object.keys(this.roles.工作台)
+        //     for (let index = 0; index < this.list.length; index++) {
+        //         for (let index2 = 0; index2 < keys.length; index2++) {
+        //             if (this.roles.工作台[keys[index2]] && this.roles.工作台[keys[index2]].name == this.list[index].name) {
+        //                 this.list[index] = Object.assign({},this.list[index],this.roles.工作台[keys[index2]])
+        //                 break;
+        //             }
+        //         }
+        //     }
 
-            let keys2 = Object.keys(this.roles.工作台导航)
-            for (let index = 0; index < this.list2.length; index++) {
-                for (let index2 = 0; index2 < keys2.length; index2++) {
-                    if (this.roles.工作台导航[keys2[index2]] && this.roles.工作台导航[keys2[index2]].name == this.list2[index].name) {
-                        this.list2[index] = Object.assign({},this.list2[index],this.roles.工作台导航[keys2[index2]])
-                        break;
-                    }
-                }
-            }
-            console.log(this.roles,this.list2,'权限');
+        //     let keys2 = Object.keys(this.roles.工作台导航)
+        //     for (let index = 0; index < this.list2.length; index++) {
+        //         for (let index2 = 0; index2 < keys2.length; index2++) {
+        //             if (this.roles.工作台导航[keys2[index2]] && this.roles.工作台导航[keys2[index2]].name == this.list2[index].name) {
+        //                 this.list2[index] = Object.assign({},this.list2[index],this.roles.工作台导航[keys2[index2]])
+        //                 break;
+        //             }
+        //         }
+        //     }
+        //     console.log(this.roles,this.list2,'权限');
             
-        },
+        // },
         onSearch () {
             uni.navigateTo({
                 url: '/cloud/globalSearch/index',

+ 0 - 0
static/workbench/装修预算改价.svg → static/workbench/budget.svg


+ 0 - 0
static/workbench/设计实景.svg → static/workbench/design.svg


+ 0 - 0
static/workbench/预约名单.svg → static/workbench/orderList.svg


+ 0 - 0
static/workbench/商品调整.svg → static/workbench/productChange.svg


+ 0 - 0
static/workbench/商城订单.svg → static/workbench/purchaseRecord.svg


+ 0 - 0
static/workbench/团队管理.svg → static/workbench/team.svg


+ 0 - 0
static/workbench/企业公告.svg → static/workbench/wbAffiche.svg


+ 2 - 2
store/budget/changePrice.vue

@@ -19,7 +19,7 @@
 </template>
 
 <script>
-import AForm from './my_form.vue'
+import AForm from '../../components/my_form2.vue'
 export default {
     components:{AForm},
     data () {
@@ -198,7 +198,7 @@ export default {
     box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
     box-sizing: border-box;
     padding: 5px 10px;
-    z-index: 2;
+    z-index: 5;
     .add {
         display: flex;
         align-items: center;

+ 20 - 0
utils/tool.js

@@ -247,6 +247,26 @@ function mount() {
         }
         return obj
     }
+    Vue.prototype.switchPage = app => {
+        if (app.path) {
+            uni.navigateTo({
+                url: app.path,
+                fail: (fail) => {
+                    console.log("跳转失败原因", fail)
+                }
+            })
+        } else {
+            switch (app.name) {
+                case 'design':
+                    Vue.prototype.$Http.changePage("index","案例",{active: '实景案例' })
+                    break;
+            
+                default:
+                    break;
+            }
+        }
+        console.log(app);
+    }
 }
 
 module.exports = {