diff --git a/src/assets/style/style.css b/src/assets/style/style.css index 39872b1b..867ea1af 100644 --- a/src/assets/style/style.css +++ b/src/assets/style/style.css @@ -1308,7 +1308,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte margin-right: 15px; flex-shrink: 0; display: block; - width: 10.5rem; + width: 13rem; text-align: right; } .admin_page .admin_state_item > input { diff --git a/src/assets/style/style.less b/src/assets/style/style.less index d6c040f5..68fa82cb 100644 --- a/src/assets/style/style.less +++ b/src/assets/style/style.less @@ -1428,7 +1428,7 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte display: block; // min-width: 20%; // width: 100px; - width: 10.5rem; + width: 13rem; text-align: right; } >input{ diff --git a/src/component/Administrator/coupons/addAllUser.vue b/src/component/Administrator/coupons/addAllUser.vue new file mode 100644 index 00000000..bbc91b4c --- /dev/null +++ b/src/component/Administrator/coupons/addAllUser.vue @@ -0,0 +1,277 @@ + + + + \ No newline at end of file diff --git a/src/component/Administrator/coupons/index.vue b/src/component/Administrator/coupons/index.vue new file mode 100644 index 00000000..9380859b --- /dev/null +++ b/src/component/Administrator/coupons/index.vue @@ -0,0 +1,390 @@ + + + \ No newline at end of file diff --git a/src/component/HomePage/ExportModel.vue b/src/component/HomePage/ExportModel.vue index 53b8b55a..bcddf2ab 100644 --- a/src/component/HomePage/ExportModel.vue +++ b/src/component/HomePage/ExportModel.vue @@ -80,7 +80,7 @@ :class="[key == 'disposeMoodboard'?'exportCanvasBox_item_dispose':'',imgItem?.upScaleChecked?'active':'']" draggable @dragstart="onDragstart(key,imgItem)" - @click.stop="isMoible?setDragstart(key,imgItem):''" + @click.stop="setDragstart(key,imgItem)" >
diff --git a/src/component/HomePage/renew.vue b/src/component/HomePage/renew.vue index b184b168..72d57954 100644 --- a/src/component/HomePage/renew.vue +++ b/src/component/HomePage/renew.vue @@ -35,8 +35,7 @@
$ - {{ current?.price[current?.type] }} - {{ current?.unit[current?.type] }} + {{ current?.price[current?.type] }} {{ current?.unit[current?.type] }}
+
+
{{ $t('Renew.promotionCode') }}:
+
+ {{promotionData.code}} + +
+
+ +
{{ $t('Renew.use') }}
+
+
{{promotionData.str}}
+
{{ $t('Renew.Payment') }}:
-
{ return { title:t('Renew.PersonalVersion'), @@ -163,6 +179,10 @@ export default defineComponent({ year:'HKD / Year', }, type:'year', + autoRenewal:{ + text:t('Renew.automatically'), + value:true, + }, typeList:['year'], info:'Customised plan', } @@ -177,6 +197,10 @@ export default defineComponent({ year:'HKD / Year', }, type:'year', + autoRenewal:{ + text:t('Renew.automatically'), + value:true, + }, typeList:['year'], info:'Customised plan', } @@ -227,6 +251,7 @@ export default defineComponent({ returnUrl:url, subscribeType:subscribeType,//yearly为年费,monthly为月费 wallet:'ALIPAYHK', + promotionCode:renewData.promotionData.code, } let httpsUrl = Https.httpUrls.payStripe payMethodData.isShowMark_ = true @@ -263,6 +288,38 @@ export default defineComponent({ renew.renewModel = false setPaidBack() } + const examine = ()=>{ + // renewData.promotionData.error + let price = renewData.current?.price[renewData.current?.type] + const normalNumber = Number(price.replace(/,/g, '')); + if(!renewData.promotionData.code){ + return + } + let data = { + promotionCode:renewData.promotionData.code, + price:normalNumber, + } + Https.axiosGet(Https.httpUrls.checkCoupon,{params:data}).then((rv:any)=>{ + if(rv){ + if(rv.status == "valid"){ + renewData.promotionData.error = 'true' + renewData.promotionData.oldPrice = renewData.current?.price[renewData.current?.type] + renewData.current.price[renewData.current.type] = (Number(rv.discountedPrice)).toLocaleString() + + }else{ + renewData.promotionData.error = 'false' + renewData.promotionData.str = rv.message + } + }else{ + } + }) + } + const clearPromotionCode = ()=>{ + renewData.promotionData.error = ''; + renewData.promotionData.code = '' + renewData.current.price[renewData.current.type] = renewData.promotionData.oldPrice + renewData.promotionData.oldPrice = '' + } return{ store, ...toRefs(renew), @@ -275,6 +332,8 @@ export default defineComponent({ payment, setPaidBack, completePayment, + examine, + clearPromotionCode, } }, data() { @@ -315,17 +374,6 @@ export default defineComponent({ flex: 1; justify-content: space-between; margin-bottom: 3rem; - position: relative; - } - .activity{ - position: absolute; - top: 0; - background: linear-gradient(88.13deg, #fbd2ff .91%, #e6d3ff 52.5%, #b694ff 101.09%); - border-radius: 0 2.8rem 0 1rem; - font-size: 2.4rem; - font-weight: 600; - padding: 1.5rem 2rem; - right: 0; } .price{ font-size: 6rem; @@ -339,6 +387,41 @@ export default defineComponent({ } .type{ display: flex; + &.promotion{ + flex-wrap: wrap; + justify-content: center; + align-items: center; + > .succeed{ + padding: 1rem; + display: flex; + align-items: center; + border-radius: 1rem; + background: #eee; + > i{ + display: flex; + margin-left: 1rem; + cursor: pointer; + } + } + > .input{ + display: flex; + align-items: center; + border-radius: 2rem; + border: 2px solid #000; + overflow: hidden; + padding: 0 1rem; + input{ + border: none; + height: 3rem; + } + } + > .error{ + color: red; + width: 100%; + text-align: center; + font-size: 1.2rem; + } + } > .text{ margin-right: 2rem; // font-weight: 600; diff --git a/src/lang/cn.ts b/src/lang/cn.ts index 52ddf233..4a933ea2 100644 --- a/src/lang/cn.ts +++ b/src/lang/cn.ts @@ -672,6 +672,9 @@ export default { Renew:{ title:'根据您的需求选择最佳计划', Monthly:'月付', + promotionCode:'优惠码', + use:'应用', + PromoCodeError:'请检查优惠码是否正确或者是否过期', Yearly:'年付', CreditCard:'信用卡', Alipay:'支付宝', diff --git a/src/lang/en.ts b/src/lang/en.ts index 5dd5dd40..3e3a2e73 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -672,6 +672,9 @@ export default { title:'Select The Best Plan For Your Needs', Monthly:'Monthly', Yearly:'Yearly', + promotionCode:'Coupon', + use:'Apply', + PromoCodeError:'Please check if the promo code is correct or if the date has expired', CreditCard:'Credit Card', Alipay:'Alipay', Payment:'Payment method', diff --git a/src/router/index.ts b/src/router/index.ts index 77f898da..fc5bfa6a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -195,6 +195,12 @@ const routes: Array = [ meta:{enter:3,}, component: _import_component('Administrator/allUser.vue'), }, + { + path:'coupons', + name:'coupons', + meta:{enter:3,}, + component: _import_component('Administrator/coupons/index.vue'), + }, { path:'testClickData', name:'testClickData', diff --git a/src/tool/https.js b/src/tool/https.js index 5db5d63d..8e01bde6 100644 --- a/src/tool/https.js +++ b/src/tool/https.js @@ -265,6 +265,12 @@ export const Https = { getUserInfo:`/api/inquiry/getUserInfo`,//查询所有用户 queryTransaction:`/api/inquiry/queryTransaction`,//查询交易记录 queryTransactionDownload:`/api/inquiry/queryTransaction/download`,//导出交易记录 + createCoupon:`/api/stripe/createCoupon`,//创建优惠码 + updatePromCodeInfo:`/api/stripe/updatePromCodeInfo`,//修改优惠码 + getAllCoupons:`/api/stripe/getAllCoupons`,//查询优惠码列表 + checkCoupon:`/api/stripe/checkCoupon`,//根据优惠码获取结算后的金额 + deletePromCode:`/api/stripe/deletePromCode`,//删除优惠券 + //查询某个时间内design点击次数 getDesignStatistic:`/api/inquiry/getDesignStatistic`,//拒绝审批 getAllQuestionnaire:`/api/inquiry/getAllQuestionnaire`,//拒绝审批 diff --git a/src/views/Administrator.vue b/src/views/Administrator.vue index f590226c..5de18fd0 100644 --- a/src/views/Administrator.vue +++ b/src/views/Administrator.vue @@ -242,7 +242,13 @@ export default defineComponent({ // isShow:true, // }, ], - }], + },{ + name:'Promotion Code', + icon:'usetime', + route:'/administrator/coupons', + key:'sub12', + isShow:true, + },], openKeys: [], selectedKeys: ['sub1'], nowPageName:'All User',//当前页面名称 diff --git a/src/views/HomeMain.vue b/src/views/HomeMain.vue index b958942f..fbd3587e 100644 --- a/src/views/HomeMain.vue +++ b/src/views/HomeMain.vue @@ -92,6 +92,8 @@
+ +