123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- // pages/myWork/workDetail.js
- const api = require('../../api/index')
- const app = getApp()
- const pay = require('../../utils/pay')
- const showImage = require('../../utils/showImage')
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- imgHttp:app.globalData.imghttp,
- ticketTypeFiled:{
- '1':'ticketFillInVO',
- '2':'ticketRightsProtectionVO',
- '3':'ticketLitigationRespondingVO',
- '4':'ticketPatentApplyVO'
- },
- ticketTypes:{
- '1':'专利解读',
- '2':'我要维权',
- '3':'我要申诉',
- '4':'我要申请'
- },
- ticketProgress:{
- '1':'等待受理',
- '2':'已受理,待支付',
- '3':'正在处理中',
- '4':'已完成',
- '5':'已取消',
- '6':'已上传结果',
- },
- id:null,
- work:{},
- show:false,
- ticketFlows:[]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.setData(
- {
- id:options.id
- }
- )
- this.getTicketDetail()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- },
- showProgress(){
- var params = {
- ticketId:this.data.id
- }
- api.queryTicketFlows(params).then(res=>{
- if(res.code == 200){
- this.setData(
- {
- ticketFlows:res.data.data.reverse()
- }
- )
- }
- })
- this.setData(
- {
- show:true
- }
- )
- },
- onClose(){
- this.setData(
- {
- show:false
- }
- )
- },
- getTicketDetail(){
- var params = {
- ticketId:this.data.id
- }
- api.getTicketDetail(params).then(res=>{
- if(res.code == 200){
- this.setData(
- {
- work:res.data.data
- }
- )
- }
- })
- },
- clickBtn(e){
- var {method} =e.currentTarget.dataset
- this[method](this.data.work)
- },
- //支付3
- payMoney(data){
- var params = {
- goodType:2,
- goodUuid:data.num
- }
- wx.showLoading({
- title: '加载中',
- })
- pay.payMoney(params).then(res=>{
- console.log(res)
- if(res.errMsg == 'requestPayment:ok'){
- api.notify(
- {
- type:'success',
- message:'支付成功',
- top:wx.getStorageSync('height')
- }
- )
- this.setData(
- {
- ["work.ticketProgress"]:3
- }
- )
- }
- }).catch(error=>{
- })
- },
- //取消5
- cancel(data){
- var params = {
- id:data.id,
- process:5
- }
- api.updateTicketProcess(params).then(res=>{
- if(res.code == 200){
- this.setData(
- {
- ["work.ticketProgress"]:5
- }
- )
- }
- })
-
- },
- //确认4
- confirm(data){
- var params = {
- id:data.id,
- process:4
- }
- api.updateTicketProcess(params).then(res=>{
- if(res.code == 200){
- this.setData(
- {
- ["work.ticketProgress"]:4
- }
- )
- }
- })
- },
- //查看图片
- previewImage(e) {
- console.log(e)
- var { current,imglist,type } = e.currentTarget.dataset
- var imgs = []
- for(var i =0;i<imglist.length;i++){
- if(type == 1){
- imgs.push(this.data.imgHttp + imglist[i].guid)
- }else{
- imgs.push(this.data.imgHttp + imglist[i])
- }
-
- }
- current = this.data.imgHttp + current
- showImage.showImageList(
- {
- current,
- urls: imgs.map((n) => ({ image: n, remark: n })),
- indicatorDots: true,
- indicatorColor: '#fff',
- indicatorActiveColor: '#04BE02',
- showDelete:false
- }
- )
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|