|  |  | 
 |  |  |             </view>
 | 
 |  |  |          </view>
 | 
 |  |  |          <view class="line-gray-big"></view>
 | 
 |  |  |          <view class="form-item before-line">
 | 
 |  |  |             <view class="label required">商品等级</view>
 | 
 |  |  |             <view class="m-l-a m-r-0 flex " :class="[!dto.level?'desc-gray':'']" @click="()=>{
 | 
 |  |  |                show_select_level=true
 | 
 |  |  |             }">
 | 
 |  |  |                <view>{{dto.levelStr||dto.level || '请选择'}}</view>
 | 
 |  |  |                <u-icon class="m-l-a" name="arrow-right"></u-icon>
 | 
 |  |  |             </view>
 | 
 |  |  | 
 | 
 |  |  |          </view>
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |          <view class="form-item before-line">
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  |          <view class="form-item ">
 | 
 |  |  |             <view class="label required">商品参数详情</view>
 | 
 |  |  |             <view class="m-l-a m-r-0 flex " :class="[!dto.applicationType?'desc-gray':'']" @click="()=>{
 | 
 |  |  |             <view class="m-l-a m-r-0 flex " style="flex-wrap: nowrap;"
 | 
 |  |  |                :class="[!dto.applicationType?'desc-gray':'']" @click="()=>{
 | 
 |  |  |                if(!dto.category){
 | 
 |  |  |                   $message.showToast('请先选择分类')
 | 
 |  |  |                }else{
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  |          </view>
 | 
 |  |  |          <view class="line-gray-big"></view>
 | 
 |  |  |          <view class="form-item before-line">
 | 
 |  |  |             <view class="label required">商品等级</view>
 | 
 |  |  |             <view class="m-l-a m-r-0 flex " :class="[!dto.level?'desc-gray':'']" @click="()=>{
 | 
 |  |  |                show_select_level=true
 | 
 |  |  |             }">
 | 
 |  |  |                <view>{{dto.levelStr||dto.level || '请选择'}}</view>
 | 
 |  |  |                <u-icon class="m-l-a" name="arrow-right"></u-icon>
 | 
 |  |  |             </view>
 | 
 |  |  | 
 | 
 |  |  |          </view>
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |          <view class="form-item before-line">
 | 
 |  |  | 
 |  |  |          <view v-if="dto.video">
 | 
 |  |  |             <video :src="dto.video" style="display: block;margin: 0 auto;"></video>
 | 
 |  |  |          </view>
 | 
 |  |  |          <view class="form-item bottom-border-no">
 | 
 |  |  |             <view class="label">商品描述</view>
 | 
 |  |  |             <view class="m-l-a m-r-0 flex">
 | 
 |  |  |                <!--    <u-input type="textarea" v-model="dto.description" placeholder="请输入商品描述" type="number"
 | 
 |  |  |                   ></u-input> -->
 | 
 |  |  |                <!--                <u--textarea v-model="dto.description" style="margin-top: 16px;"
 | 
 |  |  |                   placeholder="请输入商品描述" count></u--textarea> -->
 | 
 |  |  |                <!-- <uni-easyinput  v-model="dto.description" placeholder="请输入商品描述" ></uni-easyinput> -->
 | 
 |  |  | 
 | 
 |  |  |             </view>
 | 
 |  |  |          </view>
 | 
 |  |  |          <view style="min-width: 500rpx;margin-left: 20rpx;margin-right: 20rpx;margin-top: 20rpx;">
 | 
 |  |  |             <u--textarea v-model="dto.description" autoHeight placeholder="请输入商品描述"></u--textarea>
 | 
 |  |  |          </view>
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  |          <view style="min-height: 200rpx;">
 | 
 |  |  |              
 | 
 |  |  | 
 |  |  | 
 | 
 |  |  | <script>
 | 
 |  |  |    import environments from '@/environments'
 | 
 |  |  |    import dying318picker from '@/components/dying318-picker/Picker.vue'
 | 
 |  |  |    // import dying318picker from '@/components/dying318-picker/Picker.vue'
 | 
 |  |  |    import treeFilter from '@/components/tree-filter/tree-filter.vue'
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                price: '',
 | 
 |  |  |                stock: '',
 | 
 |  |  |                params: [], //id,value
 | 
 |  |  |                description: '',
 | 
 |  |  |             },
 | 
 |  |  |             requireFields: [{
 | 
 |  |  |                name: '商品分类',
 | 
 |  |  | 
 |  |  |                   }
 | 
 |  |  | 
 | 
 |  |  |                   if (has) {
 | 
 |  |  |                      console.log('has ', tmp, hasTrue, has)
 | 
 |  |  |                      // console.log('has ', tmp, hasTrue, has)
 | 
 |  |  |                      node.push(tmp)
 | 
 |  |  |                   } else {
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |                return
 | 
 |  |  |             }
 | 
 |  |  |             var tmp = parseFloat(this.dto.price)
 | 
 |  |  |             if (isNaN(tmp) || ('' + tmp) !== ('' + this.dto.price)) {
 | 
 |  |  |             if (isNaN(tmp) || parseFloat('' + tmp).toFixed(3) !== parseFloat('' + this.dto.price).toFixed(3)) {
 | 
 |  |  |                this.$message.showToast('商品价格格式错误,精确到分')
 | 
 |  |  |                console.log('a1', ('' + tmp) )
 | 
 |  |  |                console.log('a1', ('' + this.dto.price))
 | 
 |  |  |                return
 | 
 |  |  |             }
 | 
 |  |  |             if ((tmp.toFixed(2) + '' + '0') !== tmp.toFixed(3)) {
 | 
 |  |  |             if ((tmp.toFixed(2) + '' + '0') !== ('' + tmp.toFixed(3))) {
 | 
 |  |  |                this.$message.showToast('商品价格至多精确到分')
 | 
 |  |  |                console.log('a1', (tmp.toFixed(2) + '' + '0'))
 | 
 |  |  |                console.log('a1', tmp.toFixed(3))
 | 
 |  |  |                // console.log('tmp.toFixed(2)',tmp.toFixed(2),tmp.toFixed(3))
 | 
 |  |  |                return
 | 
 |  |  |             } else {
 | 
 |  |  |                this.dto.price = this.dto.price.toFixed(2)
 | 
 |  |  |                this.dto.price = tmp.toFixed(2)
 | 
 |  |  |             }
 | 
 |  |  |             if (this.dto.price <= 0) {
 | 
 |  |  |                this.$message.showToast('商品价格不能小于等于0')
 | 
 |  |  | 
 |  |  |          uploadIcon(key) {
 | 
 |  |  |             console.log('that dto key', key)
 | 
 |  |  |             const that = this
 | 
 |  |  |             if (key == 'video') {
 | 
 |  |  |             if (key === 'video') {
 | 
 |  |  |                uni.chooseVideo({
 | 
 |  |  |                   maxDuration: 30,
 | 
 |  |  |                   sourceType: ['camera', 'album'],
 | 
 |  |  | 
 |  |  |          }
 | 
 |  |  |       },
 | 
 |  |  |       components: {
 | 
 |  |  |          dying318picker,
 | 
 |  |  |          // dying318picker,
 | 
 |  |  |          treeFilter
 | 
 |  |  |       }
 | 
 |  |  |    }
 |