|
|
@@ -1,7 +1,7 @@
|
|
|
import { FunCode } from "../../../constants/enum/funcode"
|
|
|
import { EOrderSrc } from "../../../constants/enum/index"
|
|
|
import { sendMsgToMQ } from "../../../services/api/common/index"
|
|
|
-import { getGoods } from "../../../services/api/orders/index"
|
|
|
+import { getGoods, queryPermancePlanTmp } from "../../../services/api/orders/index"
|
|
|
import { accountid, clientType, getErrorMsg, isEncrypted, loginid, marketid, protoHeader, timetample, userid } from "../../../services/utils"
|
|
|
import { hideLoading, showLoading, showModel, showToast } from "../../../utils/message/index"
|
|
|
import { encryptBody } from "../../../utils/websocket/crypto"
|
|
|
@@ -18,8 +18,14 @@ Page({
|
|
|
goods: <GuangZuan.GetGoods>({}),
|
|
|
/// 商品编号
|
|
|
goodsno: '',
|
|
|
+ /// 选中履约模板
|
|
|
+ tmp: <GuangZuan.PermancePlanTmp>({}),
|
|
|
/// 卖单信息
|
|
|
- order: <GuangZuan.SellOrder>({})
|
|
|
+ order: <GuangZuan.SellOrder>({}),
|
|
|
+ /// 颜色
|
|
|
+ colors: ['rebeccapurple', 'green', 'yellow', 'orange', 'darkgoldenrod'],
|
|
|
+ /// 操作
|
|
|
+ operator: 1
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -53,6 +59,30 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /// 获取履约模板信息
|
|
|
+ queryPermancePlanTmp() {
|
|
|
+ /// showLoading
|
|
|
+ showLoading(() => {
|
|
|
+ queryPermancePlanTmp({
|
|
|
+ data: {
|
|
|
+ marketid: marketid()
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ /// 获取数据
|
|
|
+ this.setData({
|
|
|
+ tmps: res.data,
|
|
|
+ tmp: res.data[0],
|
|
|
+ actions: res.data.map(obj => { return obj.templatename })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ complete: () => {
|
|
|
+ /// hideLoading
|
|
|
+ hideLoading()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/// 钻石买摘牌接口
|
|
|
doZSBuyOrderDesting() {
|
|
|
/// showModel
|
|
|
@@ -109,6 +139,53 @@ Page({
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 添加收藏
|
|
|
+ */
|
|
|
+ onFavoriteOperator() {
|
|
|
+ /// loding.....
|
|
|
+ showLoading(()=>{
|
|
|
+ /// 委托单号
|
|
|
+ const wrtradeorderid = this.data.goods.wrtradeorderid
|
|
|
+ /// 参数信息
|
|
|
+ const info = JSON.stringify({
|
|
|
+ UserID: userid(),
|
|
|
+ OperateType: this.data.operator === 1 ? 2 : 1,
|
|
|
+ ClientType: clientType(),
|
|
|
+ MarketID: marketid(),
|
|
|
+ ClientSerialNo: timetample().toString(),
|
|
|
+ WRTradeOrderID: wrtradeorderid,
|
|
|
+ Header: protoHeader(FunCode.GoodsFavoriteOperateReq)
|
|
|
+ })
|
|
|
+ /// 发送请求
|
|
|
+ sendMsgToMQ({
|
|
|
+ data: {
|
|
|
+ data: encryptBody(info),
|
|
|
+ funCodeReq: FunCode.GoodsFavoriteOperateReq,
|
|
|
+ funCodeRsp: FunCode.GoodsFavoriteOperateRsp,
|
|
|
+ isEncrypted: isEncrypted()
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ /// 解析对象
|
|
|
+ const data = JSON.parse(res.data.data)
|
|
|
+ if (data.RetCode != 0) {
|
|
|
+ hideLoading(() => {}, getErrorMsg(data.RetCode), 'error')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ /// 操作成功
|
|
|
+ hideLoading(()=>{
|
|
|
+ /// 是否收藏
|
|
|
+ this.setData({ operator: this.data.operator === 1 ? 2 : 1 })
|
|
|
+ }, '请求成功', 'success')
|
|
|
+ },
|
|
|
+ fail: (emsg) => {
|
|
|
+ /// 操作失败
|
|
|
+ hideLoading(()=>{}, emsg, 'error')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options: any) {
|
|
|
@@ -121,6 +198,8 @@ Page({
|
|
|
this.setData({ goodsno: options.goodsno })
|
|
|
/// 获取商品数据
|
|
|
this.getGoods()
|
|
|
+ /// 查询履约模板信息
|
|
|
+ this.queryPermancePlanTmp()
|
|
|
},
|
|
|
|
|
|
/**
|