Commit cab311ea authored by chenwei's avatar chenwei

Merge branch 'feature' into 'dev'

复制分享和推荐 功能

See merge request !11
parents 4bdadadf 1c0ae7a3
...@@ -570,80 +570,80 @@ export default { ...@@ -570,80 +570,80 @@ export default {
view: "view", view: "view",
}, },
orderdetail: { orderdetail: {
orderNo: 'orderNo', orderNo: "orderNo",
deliveryDate: 'deliveryDate', deliveryDate: "deliveryDate",
transport: 'transportation', transport: "transportation",
channel: 'Delivery channels', channel: "Delivery channels",
startTitle: 'Original warehouse', startTitle: "Original warehouse",
destTitle: 'Destination warehouse', destTitle: "Destination warehouse",
startAddress: 'startAddress', startAddress: "startAddress",
consignorName: 'consignorName', consignorName: "consignorName",
consignorCompany: 'consignorCompany', consignorCompany: "consignorCompany",
consignorNameEn: 'English consignorName', consignorNameEn: "English consignorName",
consignorCompanyEn: 'English consignorCompany', consignorCompanyEn: "English consignorCompany",
consignorPhone: 'consignorPhone', consignorPhone: "consignorPhone",
consignorEmail: 'consignorEmail', consignorEmail: "consignorEmail",
consigneeName: 'consigneeName', consigneeName: "consigneeName",
consigneeCompany: 'consigneeCompany', consigneeCompany: "consigneeCompany",
consigneeNameEn: 'English consigneeName', consigneeNameEn: "English consigneeName",
consigneeCompanyEn: ' English consigneeCompany', consigneeCompanyEn: " English consigneeCompany",
consigneeEmail: 'consigneeEmail', consigneeEmail: "consigneeEmail",
consigneePhone: 'consigneePhone', consigneePhone: "consigneePhone",
marks: 'marks', marks: "marks",
isCargoControl: 'Is cargo on hold', isCargoControl: "Is cargo on hold",
baseInfo: 'baseInfo', baseInfo: "baseInfo",
transportInfo: 'transport', transportInfo: "transport",
costVO: 'orderInfo', costVO: "orderInfo",
box: 'CTNS', box: "CTNS",
is: 'yes', is: "yes",
no: 'no', no: "no",
warehouseNum: 'warehouseNum', warehouseNum: "warehouseNum",
entry: 'receipt data ', entry: "receipt data ",
warehouseType: 'warehouseType', warehouseType: "warehouseType",
customsType: 'Customs declaration', customsType: "Customs declaration",
isCollection: 'collection', isCollection: "collection",
activeFirst: 'Details of the goods', activeFirst: "Details of the goods",
activeSecond: 'Order status', activeSecond: "Order status",
activeThree: 'Packing list', activeThree: "Packing list",
prodTitleZh: 'Chinese item name', prodTitleZh: "Chinese item name",
prodTitleEn: 'English item name', prodTitleEn: "English item name",
brand: 'brand', brand: "brand",
num: 'num', num: "num",
sumNum: 'sumNum', sumNum: "sumNum",
unit: 'unit', unit: "unit",
worth: 'worth', worth: "worth",
material: 'material', material: "material",
volume: 'volume(m3)', volume: "volume(m3)",
weight: 'weight(kg)', weight: "weight(kg)",
noData: 'noData', noData: "noData",
notOrderData: 'notOrderData', notOrderData: "notOrderData",
showWarehouseReceipt: 'showWarehouseReceipt', showWarehouseReceipt: "showWarehouseReceipt",
showLadingBill: 'showLadingBill', showLadingBill: "showLadingBill",
hiddenText: 'Show', hiddenText: "Show",
showText: 'Hide', showText: "Hide",
transInfo: 'Transportation information', transInfo: "Transportation information",
own: "selp pickup", own: "selp pickup",
toRoom: "to door", toRoom: "to door",
typeName:"value-added services", typeName: "value-added services",
service: "Gether transpotation", service: "Gether transpotation",
oversears: "overseas cargo", oversears: "overseas cargo",
consignor: "consignor", consignor: "consignor",
consignee: "consignee", consignee: "consignee",
objectport:'Destination port customs clearance', objectport: "Destination port customs clearance",
ourUndertakes:'Our company undertakes', ourUndertakes: "Our company undertakes",
customerUndertakes:'Customer Undertaking', customerUndertakes: "Customer Undertaking",
tiedanPrice:"Does the bill of lading display the price", tiedanPrice: "Does the bill of lading display the price",
warehouseName:"Warehouse", warehouseName: "Warehouse",
externalWarehouse:'External warehouse', externalWarehouse: "External warehouse",
estLoading:"Loading time", estLoading: "Loading time",
loadingAddress:"Loading address", loadingAddress: "Loading address",
creator:'creator', creator: "creator",
customerManage:"Customer Manager", customerManage: "Customer Manager",
prodTitle:"item name", prodTitle: "item name",
inWarehouseInfo:"Warehouse entry information", inWarehouseInfo: "Warehouse entry information",
packing:"packing", packing: "packing",
tiandanExpressNO:"prefill express tracking number", tiandanExpressNO: "prefill express tracking number",
feeData:'Fee data' feeData: "Fee data",
}, },
customer: { customer: {
none: "none", none: "none",
...@@ -882,6 +882,7 @@ export default { ...@@ -882,6 +882,7 @@ export default {
createTime: "createTime", createTime: "createTime",
}, },
integral: { integral: {
copyBtn: "Copy",
headerTitle: "Distinguished", headerTitle: "Distinguished",
spend: "Redeemed points are", spend: "Redeemed points are",
available: "Available credits are", available: "Available credits are",
......
...@@ -554,80 +554,80 @@ export default { ...@@ -554,80 +554,80 @@ export default {
view: "查看", view: "查看",
}, },
orderdetail: { orderdetail: {
orderNo: '订单编号', orderNo: "订单编号",
deliveryDate: '送货时间', deliveryDate: "送货时间",
transport: '运输方式', transport: "运输方式",
channel: '出货渠道', channel: "出货渠道",
startTitle: '始发仓', startTitle: "始发仓",
destTitle: '目的仓', destTitle: "目的仓",
startAddress: '地址', startAddress: "地址",
consignorName: '发货人', consignorName: "发货人",
consignorCompany: '发货人公司名称', consignorCompany: "发货人公司名称",
consignorNameEn: '发货人英文名称', consignorNameEn: "发货人英文名称",
consignorCompanyEn: '发货人公司英文名称', consignorCompanyEn: "发货人公司英文名称",
consignorPhone: '发货人电话', consignorPhone: "发货人电话",
consignorEmail: '发货人邮箱', consignorEmail: "发货人邮箱",
consigneeName: '收货人', consigneeName: "收货人",
consigneeCompany: '公司名称', consigneeCompany: "公司名称",
consigneeNameEn: '英文名称', consigneeNameEn: "英文名称",
consigneeCompanyEn: '公司英文名称', consigneeCompanyEn: "公司英文名称",
consigneeEmail: '邮箱', consigneeEmail: "邮箱",
consigneePhone: '电话', consigneePhone: "电话",
marks: '唛头', marks: "唛头",
isCargoControl: '是否控货', isCargoControl: "是否控货",
baseInfo: '基础', baseInfo: "基础",
transportInfo: '运输', transportInfo: "运输",
costVO: '填单信息', costVO: "填单信息",
box: '', box: "",
is: '', is: "",
no: '', no: "",
warehouseNum: '仓库实测', warehouseNum: "仓库实测",
entry: '收款数据', entry: "收款数据",
warehouseType: '入仓类型', warehouseType: "入仓类型",
customsType: '单证报关', customsType: "单证报关",
isCollection: '代收货款', isCollection: "代收货款",
activeFirst: '货物详情', activeFirst: "货物详情",
activeSecond: '订单动态', activeSecond: "订单动态",
activeThree: '运单资料/提货单', activeThree: "运单资料/提货单",
prodTitleZh: '中文品名', prodTitleZh: "中文品名",
prodTitleEn: '英文品名', prodTitleEn: "英文品名",
brand: '品牌', brand: "品牌",
num: '填单件数', num: "填单件数",
sumNum: '入仓件数', sumNum: "入仓件数",
unit: '单位', unit: "单位",
worth: '货值', worth: "货值",
material: '材质', material: "材质",
volume: '体积(m3)', volume: "体积(m3)",
weight: '重量(kg)', weight: "重量(kg)",
noData: '暂无数据', noData: "暂无数据",
notOrderData: '暂无订单动态数据', notOrderData: "暂无订单动态数据",
showWarehouseReceipt: '查看入仓单', showWarehouseReceipt: "查看入仓单",
showLadingBill: '查看提货单', showLadingBill: "查看提货单",
hiddenText: '隐藏', hiddenText: "隐藏",
showText: '展示', showText: "展示",
transInfo: '运输信息', transInfo: "运输信息",
own: "自提", own: "自提",
toRoom: "送货上门", toRoom: "送货上门",
typeName:"增值服务", typeName: "增值服务",
service: "集运", service: "集运",
oversears: "海外仓", oversears: "海外仓",
consignor: "发货人", consignor: "发货人",
consignee: "收货人", consignee: "收货人",
objectport:'目的港清关', objectport: "目的港清关",
ourUndertakes:'我司承接', ourUndertakes: "我司承接",
customerUndertakes:'客户承接', customerUndertakes: "客户承接",
tiedanPrice:"提单是否显示价格", tiedanPrice: "提单是否显示价格",
warehouseName:"仓库", warehouseName: "仓库",
externalWarehouse:'外部仓', externalWarehouse: "外部仓",
estLoading:"装柜时间", estLoading: "装柜时间",
loadingAddress:"装柜地址", loadingAddress: "装柜地址",
creator:'创建人', creator: "创建人",
customerManage:"客户经理", customerManage: "客户经理",
prodTitle:"品名", prodTitle: "品名",
inWarehouseInfo:"入仓信息", inWarehouseInfo: "入仓信息",
packing:"包装", packing: "包装",
tiandanExpressNO:"填单快递单号", tiandanExpressNO: "填单快递单号",
feeData:'收费数据' feeData: "收费数据",
}, },
customer: { customer: {
none: "", none: "",
...@@ -1146,6 +1146,7 @@ export default { ...@@ -1146,6 +1146,7 @@ export default {
prompt: "提示", prompt: "提示",
}, },
integral: { integral: {
copyBtn: "复制",
headerTitle: "尊贵的", headerTitle: "尊贵的",
spend: "已兑换积分为", spend: "已兑换积分为",
available: "可用积分为", available: "可用积分为",
...@@ -1153,8 +1154,8 @@ export default { ...@@ -1153,8 +1154,8 @@ export default {
logExchange: "兑换日志", logExchange: "兑换日志",
redeemGifts: "兑换礼品", redeemGifts: "兑换礼品",
pointsCampaign: "积分活动", pointsCampaign: "积分活动",
pointsTitle: "选择兑换网", pointsTitle: "选择提货",
pointsRemark: "不同点兑换积分不同", pointsRemark: "不同提货点兑换积分不同",
outlets: "请选择网点", outlets: "请选择网点",
remainder: `剩余{value}份`, remainder: `剩余{value}份`,
orderMail: "确定订单", orderMail: "确定订单",
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
v-for="item in list" v-for="item in list"
:key="item.id" :key="item.id"
class="int-content" class="int-content"
@click="toDetail(item.id)"
> >
<div class="box" @click="toDetail(item.id)">
<div class="int-content-left"> <div class="int-content-left">
<div class="content-tag"> <div class="content-tag">
<div class="tag-text">{{ locale === 'zh_CN' ? item.typeZh : item.typeEn }}</div> <div class="tag-text">
{{ locale === "zh_CN" ? item.typeZh : item.typeEn }}
</div>
</div> </div>
<img <img
class="content-image" class="content-image"
...@@ -16,8 +18,16 @@ ...@@ -16,8 +18,16 @@
> >
</div> </div>
<div class="int-content-right"> <div class="int-content-right">
<div class="content-title">{{ locale === 'zh_CN' ? item.titleZh : item.titleEn }}</div> <div class="content-title">
<div class="content-text">{{ locale === 'zh_CN' ? item.descZh : item.descEn }}</div> {{ locale === "zh_CN" ? item.titleZh : item.titleEn }}
</div>
<div class="content-text">
{{ locale === "zh_CN" ? item.descZh : item.descEn }}
</div>
</div>
</div>
<div v-if="item.type == 3||item.type == 4" :class="'copyBtn copyBtn'+item.id" :data-clipboard-text="getCopyText(item)" @click="handleCopyBtn(item, $event)">
{{ $t("integral.copyBtn") }}
</div> </div>
</div> </div>
</div> </div>
...@@ -25,6 +35,7 @@ ...@@ -25,6 +35,7 @@
<script> <script>
import { integralActivityList } from '@/api/integral' import { integralActivityList } from '@/api/integral'
import ClipboardJS from 'clipboard'
export default { export default {
name: 'IntegralActivity', name: 'IntegralActivity',
data() { data() {
...@@ -41,10 +52,35 @@ export default { ...@@ -41,10 +52,35 @@ export default {
this.getIntegralList() this.getIntegralList()
}, },
methods: { methods: {
getCopyText(item) {
if (item.type == 3) {
return `${this.locale === 'zh_CN' ? item.extraRecommend.shareContentZh : item.extraRecommend.shareContentEn} ${item.recommendUrl} `
} else if (item.type == 4) {
return `${this.locale === 'zh_CN' ? item.titleZh
: item.titleEn} ${item.extraShare.activityUrl} `
}
},
// 复制按钮
handleCopyBtn(item, e) {
const clipboard = new ClipboardJS(`.copyBtn${item.id}`)
this.$nextTick(() => {
clipboard.on('success', () => {
this.$message.success(this.$t('复制成功'))
clipboard.destroy()
})
clipboard.on('error', () => {
this.$message.error(this.$t('复制失败'))
clipboard.destroy()
})
})
},
// 获取活动列表 // 获取活动列表
async getIntegralList() { async getIntegralList() {
try { try {
const { code, data } = await integralActivityList({ platform: 3 }) const { code, data } = await integralActivityList({
platform: 3,
memberId: this.$store.getters.id
})
if (code !== 0) return if (code !== 0) return
this.list = data this.list = data
} catch (err) { } catch (err) {
...@@ -65,6 +101,10 @@ export default { ...@@ -65,6 +101,10 @@ export default {
height: inherit; height: inherit;
overflow-y: auto; overflow-y: auto;
} }
.box{
display: flex;
width: 100%;
}
.int-content { .int-content {
margin-bottom: 10px; margin-bottom: 10px;
width: 100%; width: 100%;
...@@ -73,6 +113,17 @@ export default { ...@@ -73,6 +113,17 @@ export default {
padding: 0 15px; padding: 0 15px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #e7e7e7; border-bottom: 1px solid #e7e7e7;
position: relative;
.copyBtn{
position: absolute;
right: 0;
bottom: 10px;
border: 1px solid #2c78eb;
color:#2c78eb;
font-size: 14px;
padding: 4px 20px;
border-radius: 100px;
}
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
...@@ -86,15 +137,19 @@ export default { ...@@ -86,15 +137,19 @@ export default {
height: 100px; height: 100px;
} }
} }
.int-content-right { .int-content-right {
flex: 1; flex: 1;
height: inherit; height: inherit;
padding-left: 10px; padding-left: 10px;
box-sizing: border-box; box-sizing: border-box;
position: relative;
.content-title { .content-title {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
margin-bottom: 10px; margin-bottom: 10px;
} }
.content-text { .content-text {
font-size: 12px; font-size: 12px;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
}" }"
class="cascader" class="cascader"
:options="nodeList" :options="nodeList"
@visible-change="changeSelect"
:placeholder="$t('integral.outlets')" :placeholder="$t('integral.outlets')"
@visible-change="changeSelect"
/> />
</div> </div>
<div class="list"> <div class="list">
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
class="imgs" class="imgs"
:src="language == 'zh_CN' ? item.imgZh : item.imgEn" :src="language == 'zh_CN' ? item.imgZh : item.imgEn"
alt="" alt=""
/> >
<div class="gift-tag"> <div class="gift-tag">
<div class="tags"> <div class="tags">
<img class="tag-image" src="@/assets/integral/score.png" /> <img class="tag-image" src="@/assets/integral/score.png">
<div class="tag-text">{{ item.pointsRequire }}</div> <div class="tag-text">{{ item.pointsRequire }}</div>
</div> </div>
</div> </div>
...@@ -62,9 +62,10 @@ ...@@ -62,9 +62,10 @@
</template> </template>
<script> <script>
import { integralList, getBranchList } from "@/api/integral"; import { integralList, getBranchList } from '@/api/integral'
export default { export default {
name: "IntegralExchange", name: 'IntegralExchange',
data() { data() {
return { return {
list: [], list: [],
...@@ -72,72 +73,73 @@ export default { ...@@ -72,72 +73,73 @@ export default {
nodeList: [], nodeList: [],
selectedNodeId: null, selectedNodeId: null,
checkStrictly: true, checkStrictly: true,
cascaderState: true, cascaderState: true
}; }
}, },
computed: { computed: {
language() { language() {
this.cascaderState = false; // eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.cascaderState = false
this.$nextTick(() => { this.$nextTick(() => {
this.cascaderState = true; this.cascaderState = true
}); })
return this.$store.getters.language; return this.$store.getters.language
}, }
}, },
watch: { watch: {
selectedNodeId(val) { selectedNodeId(val) {
if (val && val.length > 2) { if (val && val.length > 2) {
this.nodeId = val[val.length - 1]; this.nodeId = val[val.length - 1]
this.getIntegralList(); this.getIntegralList()
}
} }
},
}, },
created() { created() {
this.getIntegralList(); this.getIntegralList()
this.getNodeInfo(); this.getNodeInfo()
}, },
methods: { methods: {
changeSelect() { changeSelect() {
this.checkStrictly = false; this.checkStrictly = false
}, },
// 获取礼品列表 // 获取礼品列表
async getIntegralList() { async getIntegralList() {
try { try {
const memberId = this.$store.getters.id; const memberId = this.$store.getters.id
const { code, data } = await integralList({ const { code, data } = await integralList({
memberId, memberId,
nodeId: this.nodeId, nodeId: this.nodeId
}); })
if (code !== 0) return; if (code !== 0) return
this.list = data.list; this.list = data.list
if (!this.nodeId) { if (!this.nodeId) {
if (data.city) { if (data.city) {
this.selectedNodeId = [data.country, data.city]; this.selectedNodeId = [data.country, data.city]
} else { } else {
this.selectedNodeId = [data.country]; this.selectedNodeId = [data.country]
} }
} }
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
// 获取网点信息 // 获取网点信息
async getNodeInfo() { async getNodeInfo() {
try { try {
const { code, data } = await getBranchList(); const { code, data } = await getBranchList()
if (code !== 0) return; if (code !== 0) return
this.nodeList = data; this.nodeList = data
console.log(data); console.log(data)
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, },
// 跳转详情 // 跳转详情
toDetail(id) { toDetail(id) {
this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id } }); this.$router.push({ path: `/jiedao/jd-exchange-operate`, query: { id }})
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-tabs class="headerTab" :stretch="true" v-model="paramsInfo.redeemType"> <el-tabs v-model="paramsInfo.redeemType" class="headerTab" :stretch="true">
<el-tab-pane <el-tab-pane
v-for="item in rewardDetailsInfo.pickMethodList" v-for="item in rewardDetailsInfo.pickMethodList"
:name="item.value"
:key="item.value" :key="item.value"
:name="item.value"
> >
<span slot="label">{{ isChinese ? item.labelZh : item.labelEn }}</span> <span slot="label">{{ isChinese ? item.labelZh : item.labelEn }}</span>
<div class="card"> <div class="card">
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
src="@/assets/integral/house.png" src="@/assets/integral/house.png"
alt="" alt=""
srcset="" srcset=""
/> >
<i <i
v-else v-else
class="el-icon-location-information adress-icon iconColor" class="el-icon-location-information adress-icon iconColor"
></i> />
</div> </div>
<div <div
class="addressInfo"
v-if="addressInfo.phone && paramsInfo.redeemType != 1" v-if="addressInfo.phone && paramsInfo.redeemType != 1"
class="addressInfo"
> >
<div class="adress_detail">{{ addressInfo.address }}</div> <div class="adress_detail">{{ addressInfo.address }}</div>
<div class="adress_personal"> <div class="adress_personal">
...@@ -33,16 +33,16 @@ ...@@ -33,16 +33,16 @@
</div> </div>
</div> </div>
<i <i
class="el-icon-arrow-right adress-icon"
v-if="paramsInfo.redeemType != 1" v-if="paramsInfo.redeemType != 1"
></i> class="el-icon-arrow-right adress-icon"
<div class="node-detail" v-if="paramsInfo.redeemType == 1"> />
<div v-if="paramsInfo.redeemType == 1" class="node-detail">
{{ {{
isChinese ? rewardDetailsInfo.nodeZh : rewardDetailsInfo.nodeEn isChinese ? rewardDetailsInfo.nodeZh : rewardDetailsInfo.nodeEn
}} }}
</div> </div>
</div> </div>
<el-divider></el-divider> <el-divider />
<div class="giftBox"> <div class="giftBox">
<div class="item-image"> <div class="item-image">
<img <img
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
isChinese ? rewardDetailsInfo.imgZh : rewardDetailsInfo.imgEn isChinese ? rewardDetailsInfo.imgZh : rewardDetailsInfo.imgEn
" "
alt="" alt=""
/> >
<div class="gift-tag"> <div class="gift-tag">
<div class="tags"> <div class="tags">
<img class="tag-image" src="@/assets/integral/score.png" /> <img class="tag-image" src="@/assets/integral/score.png">
<div class="tag-text"> <div class="tag-text">
{{ rewardDetailsInfo.pointsRequire }} {{ rewardDetailsInfo.pointsRequire }}
</div> </div>
...@@ -84,47 +84,45 @@ ...@@ -84,47 +84,45 @@
</div> </div>
<div class="activityTime"> <div class="activityTime">
<span class="pad-20">{{ $t("exchange.activityTime") }}</span> <span class="pad-20">{{ $t("exchange.activityTime") }}</span>
<span class="textLabel" <span
class="textLabel"
>{{ parseTime(rewardDetailsInfo.startTime, "{y}-{m}-{d}") }} >{{ parseTime(rewardDetailsInfo.startTime, "{y}-{m}-{d}") }}
{{ $t("exchange.to") }} {{ $t("exchange.to") }}
{{ {{
parseTime(rewardDetailsInfo.endTime, "{y}-{m}-{d}") parseTime(rewardDetailsInfo.endTime, "{y}-{m}-{d}")
}}</span }}</span>
>
</div> </div>
</div> </div>
</div> </div>
<div class="exchangeNumber"> <div class="exchangeNumber">
<el-input-number <el-input-number
v-model="paramsInfo.rewardCount" v-model="paramsInfo.rewardCount"
@change="handleChange"
size="mini" size="mini"
:min="1" :min="1"
></el-input-number> @change="handleChange"
/>
</div> </div>
<el-divider></el-divider> <el-divider />
<div class="verificationCode"> <div class="verificationCode">
<el-input <el-input
v-model="paramsInfo.code" v-model="paramsInfo.code"
:placeholder="$t('exchange.inputVerificationCode')" :placeholder="$t('exchange.inputVerificationCode')"
></el-input> />
<el-button <el-button
type="text" type="text"
:disabled="count < 60" :disabled="count < 60"
@click.native.prevent="getValidaCode" @click.native.prevent="getValidaCode"
>{{ getCode }}</el-button >{{ getCode }}</el-button>
>
</div> </div>
</div> </div>
<div class="textDesc"> <div class="textDesc">
<el-input <el-input
v-model="paramsInfo.remark"
type="textarea" type="textarea"
:rows="2" :rows="2"
maxlength="100" maxlength="100"
:placeholder="$t('exchange.inputPlaceholder')" :placeholder="$t('exchange.inputPlaceholder')"
v-model="paramsInfo.remark" />
>
</el-input>
<div class="maxLabel">{{ $t("exchange.maxInput") }}</div> <div class="maxLabel">{{ $t("exchange.maxInput") }}</div>
</div> </div>
<div class="confirmBox"> <div class="confirmBox">
...@@ -141,133 +139,132 @@ ...@@ -141,133 +139,132 @@
type="primary" type="primary"
round round
@click="handleSubmitRedeem" @click="handleSubmitRedeem"
>{{ $t("exchange.submitOrder") }}</el-button >{{ $t("exchange.submitOrder") }}</el-button>
>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script> <script>
import { getDictData, getDictDatas } from "@/utils/dict"; import { getDictData, getDictDatas } from '@/utils/dict'
import { addresslist, addressinfo } from "@/api/address"; import { addresslist, addressinfo } from '@/api/address'
import { import {
rewardDetails, rewardDetails,
exchangeSMSCode, exchangeSMSCode,
redeemSingleReward, redeemSingleReward
} from "@/api/integral"; } from '@/api/integral'
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from '@/utils/ruoyi'
export default { export default {
name: "ExchangeOperate", name: 'ExchangeOperate',
data() { data() {
return { return {
addressInfo: {}, addressInfo: {},
getCode: this.$t("login.getCode"), getCode: this.$t('login.getCode'),
rewardDetailsInfo: {}, rewardDetailsInfo: {},
count: 60, count: 60,
totalIntegral: 0, totalIntegral: 0,
pickMethodList: "", pickMethodList: '',
paramsInfo: { paramsInfo: {
memberId: this.$store.getters.id, memberId: this.$store.getters.id,
rewardId: this.$route.query.id, rewardId: this.$route.query.id,
redeemType: "1", redeemType: '1',
rewardCount: 1, rewardCount: 1,
entrance: "3", entrance: '3',
remark: "", remark: '',
code: "", code: ''
}, }
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
this.getCode = this.$t("login.getCode"); this.getCode = this.$t('login.getCode')
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === 'zh_CN'
}, }
}, },
created() { created() {
this.getAddressList(); this.getAddressList()
this.getRewardsDetailsAPI(); this.getRewardsDetailsAPI()
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next((vm) => { next((vm) => {
if (Object.prototype.hasOwnProperty.call(from.params, "addressId")) { if (Object.prototype.hasOwnProperty.call(from.params, 'addressId')) {
vm.handleSelectAddress(from.params.addressId); vm.handleSelectAddress(from.params.addressId)
} }
}); })
}, },
methods: { methods: {
parseTime, parseTime,
//兑换 // 兑换
handleSubmitRedeem() { handleSubmitRedeem() {
let params = { ...this.paramsInfo }; const params = { ...this.paramsInfo }
if (params.redeemType != "1") { if (params.redeemType != '1') {
params.recipientAddress = this.addressInfo.address; params.recipientAddress = this.addressInfo.address
params.recipientName = this.addressInfo.name; params.recipientName = this.addressInfo.name
params.recipientPhoneNum = this.addressInfo.phone; params.recipientPhoneNum = this.addressInfo.phone
} }
redeemSingleReward(params).then((res) => { redeemSingleReward(params).then((res) => {
this.$message({ this.$message({
message: this.$t("exchange.success"), message: this.$t('exchange.success'),
type: "success", type: 'success'
}); })
this.$router.push({ path: "/jiedao/jd-exchange-log" }); this.$router.push({ path: '/jiedao/jd-exchange-log' })
}); })
}, },
getValidaCode() { getValidaCode() {
exchangeSMSCode({ memberId: this.$store.getters.id }).then(() => { exchangeSMSCode({ memberId: this.$store.getters.id }).then(() => {
var countDown = window.setInterval(() => { var countDown = window.setInterval(() => {
if (this.count < 1) { if (this.count < 1) {
this.count = 60; this.count = 60
this.getCode = this.$t("login.getCode"); this.getCode = this.$t('login.getCode')
window.clearInterval(countDown); window.clearInterval(countDown)
} else { } else {
this.count--; this.count--
this.getCode = this.count + "s"; this.getCode = this.count + 's'
} }
}, 1000); }, 1000)
}); })
}, },
handleChange() { handleChange() {
this.totalIntegral = this.totalIntegral =
this.rewardDetailsInfo.pointsRequire * this.paramsInfo.rewardCount; this.rewardDetailsInfo.pointsRequire * this.paramsInfo.rewardCount
}, },
getAddressList() { getAddressList() {
const id = this.$store.getters.id; const id = this.$store.getters.id
addresslist({ id }).then((r) => { addresslist({ id }).then((r) => {
r.data.forEach((element) => { r.data.forEach((element) => {
element.isDefault === 0 ? (this.addressInfo = element) : ""; element.isDefault === 0 ? (this.addressInfo = element) : ''
}); })
if (this.addressInfo.isDefault != 0 && r.data.length > 0) { if (this.addressInfo.isDefault != 0 && r.data.length > 0) {
this.addressInfo = r.data[0]; this.addressInfo = r.data[0]
} }
}); })
}, },
getRewardsDetailsAPI() { getRewardsDetailsAPI() {
rewardDetails({ id: this.$route.query.id }).then((res) => { rewardDetails({ id: this.$route.query.id }).then((res) => {
this.rewardDetailsInfo = res.data; this.rewardDetailsInfo = res.data
this.paramsInfo.redeemType = this.paramsInfo.redeemType =
this.rewardDetailsInfo.pickMethodList[0].value; this.rewardDetailsInfo.pickMethodList[0].value
this.handleChange(); this.handleChange()
}); })
}, },
getPickList(label) { getPickList(label) {
return this.rewardDetailsInfo.pickMethodList return this.rewardDetailsInfo.pickMethodList
.map((item) => item[`label${label}`]) .map((item) => item[`label${label}`])
.join("/"); .join('/')
}, },
handleSelectAddress(id) { handleSelectAddress(id) {
addressinfo({ id }).then((res) => { addressinfo({ id }).then((res) => {
this.addressInfo = res.data; this.addressInfo = res.data
}); })
}, },
goAddressManagerPage() { goAddressManagerPage() {
if (this.paramsInfo.redeemType == "1") { if (this.paramsInfo.redeemType == '1') {
return; return
} }
this.$router.push("/jiedao/jd-address-manager"); this.$router.push('/jiedao/jd-address-manager')
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .headerTab .el-tabs__nav-scroll { ::v-deep .headerTab .el-tabs__nav-scroll {
......
<template> <template>
<div class="integral"> <div class="integral">
<div class="header"> <div class="header">
<div />
<div class="header-content"> <div class="header-content">
<div class="content-box"> <div class="content-box">
<div class="avatar"> <div class="avatar">
<img class="imgs" src="@/assets/integral/vip_avatar.png" alt="" /> <img class="imgs" src="@/assets/integral/vip_avatar.png" alt="">
</div> </div>
<div class="content-text"> <div class="content-text">
<div class="text-vip"> <div class="text-vip">
...@@ -18,13 +17,13 @@ ...@@ -18,13 +17,13 @@
</div> </div>
</div> </div>
<div class="content-image"> <div class="content-image">
<img v-if="levelIcon" class="imgs" :src="levelIcon" alt="" /> <img v-if="levelIcon" class="imgs" :src="levelIcon" alt="">
<img <img
v-else v-else
class="imgs" class="imgs"
src="@/assets/integral/vip_avatar.png" src="@/assets/integral/vip_avatar.png"
alt="" alt=""
/> >
</div> </div>
</div> </div>
<div class="content-divider"> <div class="content-divider">
...@@ -65,14 +64,14 @@ ...@@ -65,14 +64,14 @@
</div> </div>
</template> </template>
<script> <script>
import IntegralExchange from "./components/IntegralExchange.vue"; import IntegralExchange from './components/IntegralExchange.vue'
import IntegralActivity from "./components/IntegralActivity.vue"; import IntegralActivity from './components/IntegralActivity.vue'
import { getMemberInfo } from "@/api/integral"; import { getMemberInfo } from '@/api/integral'
export default { export default {
name: "JdIntegral", name: 'JdIntegral',
components: { components: {
IntegralExchange, IntegralExchange,
IntegralActivity, IntegralActivity
}, },
data() { data() {
return { return {
...@@ -80,8 +79,8 @@ export default { ...@@ -80,8 +79,8 @@ export default {
// 会员积分信息 // 会员积分信息
integralInfo: {}, integralInfo: {},
// 会员图标 // 会员图标
levelIcon: "", levelIcon: ''
}; }
}, },
computed: { computed: {
score() { score() {
...@@ -91,40 +90,40 @@ export default { ...@@ -91,40 +90,40 @@ export default {
(this.integralInfo.totalScore / this.integralInfo.upperCount) * 100 (this.integralInfo.totalScore / this.integralInfo.upperCount) * 100
), ),
100 100
); )
}
return 0
} }
return 0;
},
}, },
created() { created() {
this.getIntegralInfo(); this.getIntegralInfo()
const { loginUser } = this.$store.state.user; const { loginUser } = this.$store.state.user
if (loginUser) { if (loginUser) {
const userScoreLevelInfo = loginUser.userScoreLevelInfo; const userScoreLevelInfo = loginUser.userScoreLevelInfo
this.levelIcon = userScoreLevelInfo.levelIcon; this.levelIcon = userScoreLevelInfo.levelIcon
console.log(this.levelIcon); console.log(this.levelIcon)
} }
}, },
methods: { methods: {
// 跳转 日志 // 跳转 日志
toJump(val) { toJump(val) {
const path = const path =
val === 1 ? "/jiedao/jd-integral-log" : "/jiedao/jd-exchange-log"; val === 1 ? '/jiedao/jd-integral-log' : '/jiedao/jd-exchange-log'
this.$router.push({ path }); this.$router.push({ path })
}, },
// 获取个人积分信息 // 获取个人积分信息
async getIntegralInfo() { async getIntegralInfo() {
try { try {
const id = this.$store.getters.id; const id = this.$store.getters.id
const { code, data } = await getMemberInfo({ id }); const { code, data } = await getMemberInfo({ id })
if (code !== 0) return; if (code !== 0) return
this.integralInfo = data; this.integralInfo = data
} catch (err) { } catch (err) {
console.log(err); console.log(err)
} }
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.integral { .integral {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment