editOutbound.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view class="container outbound-content">
  3. <!-- 这里顶部安全是状态栏 -->
  4. <view class="status_bar" color="#000000" :style="'height:' + demoTop + 'px;'"> </view>
  5. <!-- 自定义状态栏 -->
  6. <view class="status_title">
  7. <u-icon name="arrow-left" size="38" @click="backArrowleft"></u-icon>
  8. <view class="status_center">{{ isShowTitle }}</view>
  9. </view>
  10. <!-- 文本提示 -->
  11. <view class="top-box" v-if="isShowTitle == '修改外呼号码' || identification == '邮箱'"> 修改后的外呼号码,将作为您的默认外呼号码,若后期还需修改,可在【我的】-【外呼号码】页面设置 </view>
  12. <!-- 输入外呼手机号 -->
  13. <view class="item-box">
  14. <view class="ipt-item">
  15. <label class="item-label item-iphone" @click="areaCode">+{{ telephone }} <u-icon :name="areacodeShow ? 'arrow-up' : 'arrow-down'" color="#3385FF" size="28"></u-icon></label>
  16. <input type="text" v-model="phoneIpt" class="ipt" placeholder="请输入外呼号码" />
  17. </view>
  18. <text class="text-box">座机号请填写区号,分机号用"-"分隔,例:02150509999-8888</text>
  19. </view>
  20. <!-- 底部确认 和取消 -->
  21. <view class="bottom-btn">
  22. <view class="submit-box" @click="submit"> 提交 </view>
  23. <view class="cancel" v-if="isShowTitle !== '设置外呼号码'" @click="cancelModification"> 取消修改 </view>
  24. </view>
  25. <!-- 选择区号部分 -->
  26. <view class="select-box">
  27. <u-popup v-model="areacodeShow" mode="bottom" @close="areacodeShow = false">
  28. <view class="box" style="color: #333333; font-size: 28rpxrpx">请选择您的国际区号</view>
  29. <view class="box" style="color: #2c83ff" @click="areacode('86')">大陆+86</view>
  30. <view class="box" style="color: #2c83ff" @click="areacode('852')">香港+852</view>
  31. <view class="box" style="color: #2c83ff" @click="areacode('886')">台湾+886</view>
  32. <view class="box" style="color: #2c83ff" @click="areacode('1')">美国+1</view>
  33. <view class="box" style="color: #2c83ff" @click="areacode('65')">新加坡+65</view>
  34. <view class="box box-bottom" style="color: #a9afb8" @click="areacodeShow = false">取消</view>
  35. </u-popup>
  36. </view>
  37. <!-- 关注公众号 弹框 -->
  38. <u-modal
  39. v-model="goFollowShow"
  40. :content-style="{ fontSize: '32rpx' }"
  41. @confirm="goFollowShowBtn"
  42. :show-cancel-button="true"
  43. confirm-text="去关注"
  44. @cancel="cancelDialog"
  45. :show-title="false"
  46. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  47. :confirm-style="{ fontWeight: '700' }"
  48. >
  49. <view class="slot-content">
  50. <rich-text :nodes="accounts"></rich-text>
  51. </view>
  52. </u-modal>
  53. <!-- 知道的弹框 -->
  54. <u-modal v-model="show" :content="content" :content-style="{ fontSize: '32rpx' }" @confirm="cancelDialog" :show-title="false" confirm-text="知道了" :confirm-style="{ fontWeight: '700' }">
  55. <view class="slot-content">
  56. <rich-text :nodes="content"></rich-text>
  57. </view>
  58. </u-modal>
  59. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  60. </view>
  61. </template>
  62. <script>
  63. import { activity } from "@/config/api.js";
  64. import freeCharge from '@/components/freeCharge'
  65. export default {
  66. data() {
  67. return {
  68. phoneIpt: "",
  69. isShowTitle: "设置",
  70. telephone: "86",
  71. areacodeShow: false,
  72. identification: "",
  73. goFollowShow: false,
  74. accounts: "",
  75. show: false,
  76. content: "",
  77. demoTop: "",
  78. id: "",
  79. goOnNextStep: "",
  80. cellphone: "",
  81. };
  82. },
  83. components: {
  84. freeCharge
  85. },
  86. methods: {
  87. areaCode() {
  88. this.areacodeShow = true;
  89. },
  90. areacode(code) {
  91. this.telephone = code;
  92. this.areacodeShow = false;
  93. },
  94. //提交
  95. submit() {
  96. activity
  97. .addOutboundMobile({
  98. ActivityId: Number(this.id),
  99. OutboundCountryCode: this.telephone,
  100. OutboundMobile: this.phoneIpt,
  101. })
  102. .then((res) => {
  103. if (res.Ret !== 200) return;
  104. if (this.identification == "修改" || this.identification == "邮箱") {
  105. if (this.identification == "邮箱") {
  106. let pages = getCurrentPages();
  107. let prevPage = pages[pages.length - 2];
  108. if (prevPage.$page.fullPath == "/pages/activity/activity" || prevPage.$page.fullPath == "/pages-search/indedxSearch/indedxSearch") {
  109. const index = prevPage.$vm.collectList.findIndex((item) => item.ActivityId == this.id);
  110. prevPage.$vm.collectList[index].IsSignup = 1;
  111. }
  112. }
  113. if (this.goOnNextStep == "true") {
  114. this.accounts = `
  115. ${this.telephone}-${this.phoneIpt}<br/>
  116. 预约成功,已加入您的活动日程<br/><br/>
  117. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  118. `;
  119. this.goFollowShow = true;
  120. } else {
  121. this.content = `
  122. ${this.telephone}-${this.phoneIpt}<br/><br/>
  123. 预约外呼成功,已加入您的活动日程
  124. `;
  125. this.show = true;
  126. }
  127. } else {
  128. uni.navigateBack();
  129. }
  130. });
  131. },
  132. //取消修改
  133. cancelModification() {
  134. if (this.identification == "修改") {
  135. if (this.goOnNextStep == "true") {
  136. this.accounts = `
  137. ${this.cellphone}<br/>
  138. 预约成功,已加入您的活动日程<br/><br/>
  139. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  140. `;
  141. this.goFollowShow = true;
  142. } else {
  143. this.content = `
  144. ${this.cellphone}<br/><br/>
  145. 预约外呼成功,已加入您的活动日程
  146. `;
  147. this.show = true;
  148. }
  149. } else {
  150. uni.navigateBack();
  151. }
  152. },
  153. //去关注公众号
  154. goFollowShowBtn() {
  155. uni.redirectTo({
  156. url: "/activityPages/accountsOfficial/accountsOfficial",
  157. });
  158. },
  159. //弹框的取消
  160. cancelDialog() {
  161. uni.navigateBack();
  162. },
  163. //右上角的返回
  164. backArrowleft() {
  165. if (this.identification == "修改") {
  166. if (this.goOnNextStep == "true") {
  167. this.accounts = `
  168. ${this.cellphone}<br/>
  169. 预约成功,已加入您的活动日程<br/><br/>
  170. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  171. `;
  172. this.goFollowShow = true;
  173. } else {
  174. this.content = `
  175. ${this.cellphone}<br/><br/>
  176. 预约外呼成功,已加入您的活动日程
  177. `;
  178. this.show = true;
  179. }
  180. } else {
  181. uni.navigateBack();
  182. }
  183. },
  184. },
  185. onLoad(option) {
  186. this.isShowTitle = option.title;
  187. this.identification = option.identification;
  188. this.id = option.id || "";
  189. this.goOnNextStep = option.goOnNextStep || "";
  190. this.cellphone = option.cellphone || "";
  191. const res = uni.getSystemInfoSync();
  192. this.demoTop = res.safeArea.top;
  193. },
  194. };
  195. </script>
  196. <style scoped lang="scss">
  197. .outbound-content {
  198. /* 自定义状态栏 */
  199. .status_bar {
  200. width: 100%;
  201. }
  202. /* 自定义导航栏 */
  203. .status_title {
  204. box-sizing: border-box;
  205. display: flex;
  206. align-items: center;
  207. width: 100%;
  208. height: 88rpx;
  209. padding: 10rpx 62rpx 15rpx 30rpx;
  210. background-color: #ffffff;
  211. box-sizing: border-box;
  212. }
  213. .status_center {
  214. margin: 0 auto;
  215. font-size: 34rpx;
  216. font-weight: 400;
  217. color: #000000;
  218. }
  219. .top-box {
  220. width: 100%;
  221. background-color: #f7f7f7;
  222. padding: 20rpx 34rpx;
  223. font-size: 28rpx;
  224. font-weight: 400;
  225. line-height: 48rpx;
  226. color: #666666;
  227. }
  228. .item-box {
  229. width: 100%;
  230. margin-top: 35rpx;
  231. padding: 0 32rpx;
  232. .text-box {
  233. height: 30rpx;
  234. font-size: 22rpx;
  235. line-height: 30px;
  236. color: #999999;
  237. }
  238. }
  239. .ipt-item {
  240. padding: 33rpx 0 10rpx;
  241. border-bottom: 1rpx solid #d6d6d6;
  242. display: flex;
  243. align-items: center;
  244. font-size: 28rpx;
  245. .item-label {
  246. display: flex;
  247. justify-content: space-between;
  248. width: 105rpx;
  249. color: #3385ff;
  250. }
  251. .ipt {
  252. margin-left: 40rpx;
  253. width: 500rpx;
  254. font-size: 32rpx;
  255. color: #666;
  256. }
  257. }
  258. .bottom-btn {
  259. margin-top: 247rpx;
  260. font-size: 34rpx;
  261. text-align: center;
  262. .submit-box {
  263. margin: 0 auto;
  264. width: 368rpx;
  265. height: 80rpx;
  266. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  267. color: #ffffff;
  268. line-height: 80rpx;
  269. border-radius: 4rpx;
  270. }
  271. .cancel {
  272. margin: 30rpx auto;
  273. width: 368rpx;
  274. height: 80rpx;
  275. border: 2px solid #2c83ff;
  276. border-radius: 4rpx;
  277. line-height: 80rpx;
  278. color: #2c83ff;
  279. }
  280. }
  281. .select-box {
  282. width: 100%;
  283. .box {
  284. height: 95prx;
  285. line-height: 95rpx;
  286. text-align: center;
  287. font-size: 32rpx;
  288. border-bottom: 1rpx solid #ebebeb;
  289. }
  290. .box-bottom {
  291. border-bottom: none !important;
  292. }
  293. }
  294. }
  295. .slot-content {
  296. width: 100%;
  297. padding: 50rpx;
  298. text-align: center;
  299. font-size: 32rpx;
  300. color: #0f1826;
  301. line-height: 48rpx;
  302. }
  303. .u-model__footer__button.data-v-3626fcec {
  304. border-right: 1rpx solid #333;
  305. }
  306. </style>