information.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="basicInfo">
  7. <image :src="mainImg" style="width: 150rpx;height: 150rpx;" mode="">
  8. </image>
  9. <view class="basicInfo_txt">
  10. <p style="margin-bottom: 10rpx;font-size: 31rpx; font-weight: bold;">
  11. {{selection.selection_name}}
  12. </p>
  13. <p style="font-size: 27rpx;">售价:¥{{selection.YounggeeProduct[0].product_price}} &nbsp;&nbsp;&nbsp;&nbsp;
  14. 样叽高佣:{{selection.YounggeeProduct[0].exclusive_commission}}%</p>
  15. <p style="font-size: 27rpx;" v-if="selection.task_mode === 1">
  16. 额外悬赏:¥{{selection.RewardStrategy[0].per_reward}}</p>
  17. </view>
  18. </view>
  19. <view class="address">
  20. <view>
  21. <image class="address_icon" :src="picture.icon_loc" mode="">
  22. </image>
  23. </view>
  24. <view style="width: 70%;">
  25. <view style="display: flex;">
  26. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  27. <p class='ipon'>{{address.phone_number}}</p>
  28. </view>
  29. <p class='ipon'>{{address.full_detail_addr}}</p>
  30. </view>
  31. <view class="address_edit" @click="editAddress()">
  32. <image :src="picture.icon_edit" mode="">
  33. </image>
  34. </view>
  35. </view>
  36. <view class="keyInfo">
  37. <p style="margin-bottom: 30rpx;font-size: 36rpx; font-weight: bold;">任务要求</p>
  38. <!-- <p>内容形式:{{selection.show_content_type}}</p> -->
  39. <p>带货链接:{{selection.product_url}}
  40. <image :src="picture.icon_copy" mode="" class="copy-img" @click="handleCopy('123')" />
  41. </p>
  42. <p>领样要求:</p>
  43. <!-- 具体领样品要求(粉丝数量) -->
  44. <view class="markcontent">
  45. <view class="" v-for="item in selection.FreeStrategy">
  46. <p style=" margin-top: 20rpx; margin-bottom: 20rpx; font-size: 26rpx;">
  47. 粉丝量{{getFansLabel(item.fans_num)}},近30天橱窗销量≥{{item.sale_num}}单</p>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="account" @click="editAccount()">
  52. <view class="account_txt">
  53. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_NcjI7AD0T3viYtxQwGOvh1SwG0A_35_35.png" mode=""></image>
  54. <span>{{account.nick_name}}</span>
  55. </view>
  56. <view class="account_fans">
  57. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  58. <p>{{account.fan}}</p>
  59. </view>
  60. <view class="account_btn">
  61. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  62. </view>
  63. </view>
  64. <view class="block"></view>
  65. <view class="submit">
  66. <button type="default" class="submit_btn" @click="submit()"> 确认报名并添加橱窗</button>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import region from '@/components/pca-code.json';
  72. import mvBar from "@/components/mys_navBar/mysNavBar";
  73. import {
  74. fansview
  75. } from '@/components/utils.js';
  76. export default {
  77. components: {
  78. mvBar
  79. },
  80. data() {
  81. return {
  82. navH: getApp().globalData.navHeight,
  83. picture: getApp().globalData.picture,
  84. mysNavConfig: {
  85. isHome: false,
  86. /* 固定导航 */
  87. navFixed: true,
  88. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  89. navTitle: {
  90. text: "信息确认",
  91. color: "",
  92. fontSize: "32rpx", // px upx rpx
  93. fontWeight: "", // 100 - 700
  94. },
  95. btnType: "type2",
  96. onLeftClick: '',
  97. /* type2 按钮 */
  98. type2Config: {
  99. // 左图标
  100. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  101. // 右图标
  102. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  103. // 圆角
  104. radius: "40rpx",
  105. },
  106. },
  107. options: [{
  108. value: '1',
  109. label: '所有人均可领取'
  110. },
  111. {
  112. value: '2',
  113. label: '1w下'
  114. },
  115. {
  116. value: '3',
  117. label: '1w-10w'
  118. },
  119. {
  120. value: '4',
  121. label: '10w-100w'
  122. },
  123. {
  124. value: '5',
  125. label: '100w-500w'
  126. },
  127. {
  128. value: '6',
  129. label: '500w-1000w'
  130. },
  131. {
  132. value: '7',
  133. label: '1000w以上'
  134. },
  135. ],
  136. selection: {},
  137. product: {},
  138. youngTeamId: "",
  139. youngLeadTeamId: "",
  140. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  141. account_id: -1,
  142. address_id: -1,
  143. address: null,
  144. project: null,
  145. account: null,
  146. strategy: null,
  147. thirdPlatform: [],
  148. saleNum_30: 0,
  149. }
  150. },
  151. onShow() {
  152. // 根据address_id查询address
  153. this.getDefaultAddress();
  154. // 查询account
  155. this.getTalentAccountInfo();
  156. },
  157. onLoad(options) {
  158. this.textObj = options.textObj.replace(/""/g, "");
  159. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  160. console.log("详情页传来的数据",this.textObj)
  161. this.saleNum_30=this.textObj.saleNum_30
  162. this.selection = this.textObj.selection
  163. console.log("this.selection------>", this.selection)
  164. this.product = this.selection.YounggeeProduct[0]
  165. this.youngTeamId = this.textObj.youngTeamId
  166. this.youngLeadTeamId = this.textObj.youngLeadTeamId
  167. for (let i = 0; i < this.selection.YounggeeProductPhoto.length; ++i) {
  168. if (this.selection.YounggeeProductPhoto[i].symbol === 1) {
  169. this.mainImg = this.selection.YounggeeProductPhoto[i].photo_url
  170. }
  171. }
  172. console.log("this.mainIma---->", this.mainImg)
  173. if (this.youngLeadTeamId === "") {
  174. this.getLeadYoungTeamId()
  175. }
  176. },
  177. methods: {
  178. getFansLabel(fansNum) {
  179. const option = this.options.find(o => o.value === fansNum.toString());
  180. return option ? option.label : fansNum;
  181. },
  182. handleCopy(content) {
  183. wx.setClipboardData({
  184. data: content,
  185. success: function(res) {
  186. console.log("复制成功");
  187. }
  188. });
  189. },
  190. getLeadYoungTeamId() {
  191. // 调用后端接口,创建young之团,若young之团存在则返回teamid,否则创建young之团并返回id
  192. return this.$https.post('/youngee/c/t/p/add-young-team', {
  193. selection_id: this.selection.selection_id,
  194. project_type: 2,
  195. })
  196. .then(res => {
  197. console.log(res)
  198. this.youngLeadTeamId = res.data.data;
  199. })
  200. },
  201. //账号信息
  202. getTalentAccountInfo() {
  203. return this.$https.get('/youngee/c/t/g/get-talent-account-kuaishou')
  204. .then(res => {
  205. this.account=res.data.data[0]
  206. })
  207. // console.log("account数组——————: ",res)
  208. },
  209. getDefaultAddress() {
  210. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  211. console.log(res.data.data)
  212. this.address = res.data.data;
  213. let a = this.address.region_code.toString().slice(0, 2)
  214. let b = this.address.region_code.toString().slice(0, 4)
  215. let c = 0
  216. for (var i = 0; i < region.length; i++) {
  217. if (region[i].code == a) {
  218. a = region[i].name
  219. for (var j = 0; j < region[i].children.length; j++) {
  220. if (region[i].children[j].code == b) {
  221. b = region[i].children[j].name
  222. for (var o = 0; o < region[i].children[j].children.length; o++) {
  223. if (region[i].children[j].children[o].code == this.address
  224. .region_code) {
  225. c = region[i].children[j].children[o].name
  226. }
  227. }
  228. }
  229. }
  230. }
  231. }
  232. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  233. })
  234. },
  235. editAddress() {
  236. uni.navigateTo({
  237. url: '/page_mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  238. '&ismodify=1'
  239. });
  240. },
  241. editAccount() {
  242. uni.navigateTo({
  243. url: '/page_mycenter/bindaccounts/kuaishoubind'
  244. });
  245. },
  246. debugSubmit() {
  247. uni.navigateTo({
  248. url: '/page_tasksquare/wholetask/success'
  249. });
  250. },
  251. async submit(){
  252. //肯定有地址,样品肯定够,肯定有效期内,否则立即领样按钮无法点击
  253. console.log("api----", this.product.kuaishou_product_id)
  254. //调用加入橱窗api
  255. this.$https.get('/youngee/c/t/g/add-window' +
  256. "?" +
  257. "product_id" +
  258. "=" +
  259. this.product.kuaishou_product_id
  260. ).then(res => {
  261. console.log("add window res****", res)
  262. //未开通
  263. let api_result = res.data.data.data[0]
  264. if (api_result.result == 1800533) {
  265. uni.showModal({
  266. content: '添加橱窗失败,免费领样申请失败', // 这里设置弹窗的内容
  267. showCancel: false, // 不显示取消按钮
  268. confirmText: '知道了', // 设置确认按钮的文本
  269. success: function(res) {
  270. if (res.confirm) {
  271. console.log('用户点击知道了');
  272. }
  273. }
  274. });
  275. } else if (api_result.result == 1800550) {
  276. uni.showModal({
  277. content: '添加橱窗失败,免费领样申请失败', // 这里设置弹窗的内容
  278. showCancel: false, // 不显示取消按钮
  279. confirmText: '知道了', // 设置确认按钮的文本
  280. success: function(res) {
  281. if (res.confirm) {
  282. console.log('用户点击知道了');
  283. }
  284. }
  285. });
  286. } else {
  287. //添加到seltask带货任务中
  288. console.log("提交报名")
  289. // 直接报名
  290. console.log("********", this.selection.product_id)
  291. console.log("this.account.fan********111", this.account.fan)
  292. console.log("this.saleNum_30********111", this.saleNum_30)
  293. this.$https.post('/youngee/c/t/p/sign-up-sec-task', {
  294. address_id: this.address.address_id,
  295. selection_id: this.selection.selection_id,
  296. lead_team_id: this.youngLeadTeamId,
  297. team_id: this.youngTeamId,
  298. product_id: this.selection.product_id,
  299. //新增
  300. saleNum: this.saleNum_30,
  301. fans: this.account.fan,
  302. }).then(res => {
  303. console.log("sign-up-sec-task 的res",res)
  304. if (res.data.code == 0) {
  305. var data = {
  306. task_id: res.data.data.task_id
  307. };
  308. data = JSON.stringify(data)
  309. uni.navigateTo({
  310. url: '/page_selectionsquare/selectiondetail/success?textObj=' +
  311. encodeURIComponent(
  312. data)
  313. });
  314. } else {
  315. uni.showModal({
  316. content: '网络繁忙,请小主稍后再试~',
  317. });
  318. }
  319. })
  320. }
  321. })
  322. },
  323. },
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. text {
  328. font-size: 32rpx;
  329. }
  330. p {
  331. font-size: 32rpx;
  332. }
  333. .basicInfo {
  334. display: flex;
  335. margin: 0 40rpx;
  336. padding: 30rpx 0;
  337. .basicInfo_txt {
  338. margin-left: 40rpx;
  339. padding-top: 20rpx;
  340. }
  341. }
  342. .address {
  343. display: flex;
  344. margin: 30rpx 40rpx 0;
  345. padding: 30rpx 0;
  346. justify-content: space-around;
  347. .address_icon {
  348. vertical-align: middle;
  349. width: 50rpx;
  350. height: 50rpx;
  351. display: inline-block;
  352. padding-right: 30rpx;
  353. }
  354. .address_edit {}
  355. .address_edit image {
  356. vertical-align: middle;
  357. width: 50rpx;
  358. height: 50rpx;
  359. display: inline-block;
  360. padding-right: 14rpx;
  361. }
  362. .ipon {
  363. color: #333333;
  364. font-size: 30rpx;
  365. margin-bottom: 10rpx;
  366. }
  367. }
  368. .keyInfo {
  369. margin: 30rpx 40rpx;
  370. }
  371. .keyInfo span {
  372. display: flex;
  373. align-items: center;
  374. margin: 10rpx 0;
  375. }
  376. .keyInfo p {
  377. margin: 25rpx 0;
  378. }
  379. .account {
  380. display: flex;
  381. align-items: center;
  382. width: 690rpx;
  383. padding: 24rpx 0;
  384. margin: 0 auto;
  385. .account_txt {
  386. display: inline-block;
  387. padding: 0 0 0 1%;
  388. width: 400rpx;
  389. }
  390. .account_txt span {
  391. color: #333333;
  392. font-weight: 550;
  393. text-indent: 2em;
  394. font-size: 32rpx;
  395. }
  396. .account_txt image {
  397. vertical-align: middle;
  398. width: 50rpx;
  399. height: 50rpx;
  400. display: inline-block;
  401. padding-right: 14rpx;
  402. }
  403. .account_fans {
  404. display: flex;
  405. width: 250rpx;
  406. }
  407. .account_fans p {
  408. display: inline-block;
  409. color: #333333;
  410. font-weight: 550;
  411. }
  412. .account_btn {}
  413. }
  414. .block {
  415. width: 100%;
  416. height: 100rpx;
  417. margin-top: 5%;
  418. }
  419. .submit {
  420. box-shadow: 0rpx 5rpx 40rpx #ccc;
  421. width: 100%;
  422. position: fixed;
  423. bottom: 0rpx;
  424. display: flex;
  425. height: 90rpx;
  426. padding-top: 2%;
  427. background-color: #FFFFFF;
  428. .submit_btn {
  429. background-color: #FCCF41;
  430. border-radius: 20rpx;
  431. font-size: 30rpx;
  432. line-height: 220%;
  433. letter-spacing: 5rpx;
  434. height: 80%;
  435. }
  436. }
  437. </style>