|
@@ -1,5 +1,6 @@
|
|
|
// pages/form/rightsProtection/rightsProtection.js
|
|
|
const upload = require("../../../utils/upload")
|
|
|
+const api = require('../../../api/index')
|
|
|
import { $wuxForm} from '../../../miniprogram_npm/wux-weapp/index'
|
|
|
Page({
|
|
|
|
|
@@ -11,32 +12,42 @@ Page({
|
|
|
required: '%s 字段为必填',
|
|
|
},
|
|
|
form:{
|
|
|
- type:0,
|
|
|
- infringementType:0,
|
|
|
- infringementClassify:0,
|
|
|
- havePatentNo:1,
|
|
|
- complaintType:1,
|
|
|
+ tortStoreAdinSite:'美国站',
|
|
|
+ tortType:'发明专利',
|
|
|
+ tortClassify:'产品侵权',
|
|
|
+ ifHavePatent:true,
|
|
|
+ problemDescription:'商品详细页上使用了未经授权的图片'
|
|
|
},
|
|
|
labelWidth:350,
|
|
|
+ //站点
|
|
|
countrys:[
|
|
|
- { text: '美国站', value: 0 },
|
|
|
- { text: '日本站', value: 1 },
|
|
|
- { text: '德国站', value: 2 },
|
|
|
- { text: '英国站', value: 3 },
|
|
|
+ { text: '美国站', value: '美国站' },
|
|
|
+ { text: '日本站', value: '日本站' },
|
|
|
+ { text: '德国站', value: '德国站' },
|
|
|
+ { text: '英国站', value: '英国站' },
|
|
|
],
|
|
|
+ //侵权类型
|
|
|
typeOptions:[
|
|
|
- { text: '发明专利', value: 0 },
|
|
|
- { text: '外观设计', value: 1 },
|
|
|
- { text: '实用新型', value: 2 },
|
|
|
- { text: '商标', value: 3 },
|
|
|
- { text: '版权', value: 4 },
|
|
|
+ { text: '发明专利', value: '发明专利' },
|
|
|
+ { text: '外观设计', value: '外观设计' },
|
|
|
+ { text: '实用新型', value: '实用新型' },
|
|
|
+ { text: '商标', value: '商标' },
|
|
|
+ { text: '版权', value: '版权' },
|
|
|
],
|
|
|
- typeOptions:[
|
|
|
- { text: '产品侵权', value: 0 },
|
|
|
- { text: '图片侵权', value: 1 },
|
|
|
- { text: '背景侵权', value: 2 },
|
|
|
- { text: '文字侵权', value: 3 },
|
|
|
+ //侵权分类
|
|
|
+ typeOptions2:[
|
|
|
+ { text: '产品侵权', value: '产品侵权' },
|
|
|
+ { text: '图片侵权', value: '图片侵权' },
|
|
|
+ { text: '背景侵权', value: '背景侵权' },
|
|
|
+ { text: '文字侵权', value: '文字侵权' },
|
|
|
],
|
|
|
+ //问题描述
|
|
|
+ problemDescriptions:[
|
|
|
+ { text: '商品详细页上使用了未经授权的图片', value: '商品详细页上使用了未经授权的图片' },
|
|
|
+ { text: '实际商品或其包装包含非盗版的未授权的内容', value: '实际商品或其包装包含非盗版的未授权的内容' },
|
|
|
+ { text: '商品详情页面上使用了未经授权的文本', value: '商品详情页面上使用了未经授权的文本' },
|
|
|
+ { text: '商品或其包装为盗版(全盘复制受版权保护的商品)', value: '商品或其包装为盗版(全盘复制受版权保护的商品)' },
|
|
|
+ ]
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -66,7 +77,6 @@ Page({
|
|
|
*/
|
|
|
//表单栏位值发生变化时
|
|
|
onValuesChange(e) {
|
|
|
- console.log(e)
|
|
|
const { changedValues, allValues } = e.detail
|
|
|
// this.setValues(changedValues)
|
|
|
Object.keys(changedValues).forEach((field) => {
|
|
@@ -74,7 +84,6 @@ Page({
|
|
|
['form.'+field]: changedValues[field],
|
|
|
})
|
|
|
})
|
|
|
- console.log('onValuesChange \n', changedValues, allValues)
|
|
|
},
|
|
|
//手机号校验
|
|
|
checkPhone(rule, value){
|
|
@@ -106,44 +115,82 @@ Page({
|
|
|
changRemark(e){
|
|
|
this.setData(
|
|
|
{
|
|
|
- ["form.remark"]:e.detail.value
|
|
|
+ ["form.description"]:e.detail.value
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //修改商品是否原创
|
|
|
- onChange2(e){
|
|
|
+ //修改是否拥有专利号
|
|
|
+ onChange(e){
|
|
|
this.setData(
|
|
|
{
|
|
|
- ["form.isOriginal"]:e.detail.value
|
|
|
+ ["form.ifHavePatent"]:e.detail
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //修改被投诉类型
|
|
|
+ //修改哪一项最能描述您的问题?
|
|
|
onChange1(e){
|
|
|
this.setData(
|
|
|
{
|
|
|
- ["form.complaintType"]:e.detail.value
|
|
|
+ ["form.problemDescription"]:e.detail
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //修改被投诉类型
|
|
|
- onChange3(e){
|
|
|
- this.setData(
|
|
|
- {
|
|
|
- ["form.haveNegotiated"]:e.detail.value
|
|
|
- }
|
|
|
- )
|
|
|
+ //修改下拉菜单值
|
|
|
+ changeVanDropdownnValue(e){
|
|
|
+ var label = e.currentTarget.dataset.label
|
|
|
+ if(label){
|
|
|
+ var detail = e.detail
|
|
|
+ this.setData(
|
|
|
+ {
|
|
|
+ ["form."+label]:detail
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//提交工单
|
|
|
submit(){
|
|
|
+ var key = api.isLogin()
|
|
|
+ if(!key){
|
|
|
+ return false
|
|
|
+ }
|
|
|
const { validateFields } = $wuxForm()
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/successReminder/successReminder?id=2',
|
|
|
- })
|
|
|
+ console.log(this.data.form)
|
|
|
validateFields((err, values) => {
|
|
|
console.log(err)
|
|
|
if (!err) {
|
|
|
-
|
|
|
+ var params = {
|
|
|
+ ticketType:2,
|
|
|
+ contactPerson:this.data.form.contactPerson,
|
|
|
+ contactPhone:this.data.form.contactPhone,
|
|
|
+ contactMail:this.data.form.contactMail,
|
|
|
+ fileGuids:this.data.form.fileGuids,
|
|
|
+ protectionAddDTO:this.data.form
|
|
|
+ }
|
|
|
+ api.addTicket(params).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/successReminder/successReminder?id=2',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ var error = Object.keys(err)
|
|
|
+ var key = error[0]
|
|
|
+ var len = err[key].errors.length
|
|
|
+ var message = err[key].errors[len-1].message
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: message,
|
|
|
+ complete: (res) => {
|
|
|
+ if (res.cancel) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (res.confirm) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|