information.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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: 35rpx;">{{project.project_name}}</p>
  11. <p style="font-size: 30rpx;">商品价值:{{project.Product.ProductPrice}}元</p>
  12. </view>
  13. </view>
  14. <view class="address">
  15. <view>
  16. <image class="address_icon" :src="picture.icon_loc" mode="">
  17. </image>
  18. </view>
  19. <view style="width: 70%;">
  20. <view style="display: flex;">
  21. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  22. <p class='ipon'>{{address.phone_number}}</p>
  23. </view>
  24. <p class='ipon'>{{address.full_detail_addr}}</p>
  25. </view>
  26. <view class="address_edit" @click="editAddress()">
  27. <image :src="picture.icon_edit" mode="">
  28. </image>
  29. </view>
  30. </view>
  31. <view class="keyInfo">
  32. <!-- <p style="margin-bottom: 30rpx;font-size: 36rpx;">关键任务信息</p> -->
  33. <p style="margin-top: 10rpx;">合作佣金</p>
  34. <view style="padding-top: 10rpx;">
  35. <p>粉丝量:{{strategy.show_followers_low}}-{{strategy.show_followers_up}}
  36. </p>
  37. </view>
  38. <view style="display: flex;">
  39. <p>
  40. 稿费:{{strategy.fee_form_t}}
  41. </p>
  42. <view v-if="strategy.fee_form==3">
  43. <p>{{strategy.showOffer}}元</p>
  44. </view>
  45. </view>
  46. <!-- <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  47. <p style="margin-top: 10rpx;">社媒平台</p>
  48. <view style="display: flex;padding-top: 10rpx;">
  49. <p>{{project.PlatformInfo.platform_name}}</p>
  50. </view>
  51. <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  52. <p style="margin-top: 10rpx;">任务要求</p>
  53. <view class="keyInfo_task">
  54. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  55. <p>内容形式:</p>
  56. <p class="keyInfo_task_txt">{{project.content}}</p>
  57. </view>
  58. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  59. <p>任务形式:</p>
  60. <p class="keyInfo_task_txt">{{project.project_form}}</p>
  61. </view>
  62. <p style="margin: 5rpx 0;">商品描述:</p>
  63. <text class="keyInfo_task_txt">{{project.Product.ProductDetail}}</text>
  64. <p style="margin: 35rpx 0 0rpx;">任务详情:</p>
  65. <text class="keyInfo_task_txt">{{project.project_detail}}</text>
  66. </view> -->
  67. </view>
  68. <view class="account" @click="editAccount()">
  69. <view class="account_txt">
  70. <image :src="project.PlatformInfo.platform_icon" mode=""></image>
  71. <span>{{account.platform_nickname}}</span>
  72. </view>
  73. <view class="account_fans">
  74. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  75. <p>{{account.show_fans_count}}</p>
  76. </view>
  77. <view class="account_btn">
  78. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  79. </view>
  80. </view>
  81. <view class="block"></view>
  82. <view class="submit">
  83. <button type="default" class="submit_btn" @click="submit()"> 确认报名</button>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import region from '@/components/pca-code.json';
  89. import mvBar from "@/components/mys_navBar/mysNavBar";
  90. import {
  91. fansview
  92. } from '@/components/utils.js';
  93. export default {
  94. components: {
  95. mvBar
  96. },
  97. data() {
  98. return {
  99. navH: getApp().globalData.navHeight,
  100. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  101. account_id: -1,
  102. address_id: -1,
  103. address: null,
  104. project: null,
  105. account: null,
  106. strategy: null,
  107. picture: {
  108. togoimg: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/task16.png',
  109. icon_edit: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-edit.png',
  110. icon_loc: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-loc.png',
  111. home8: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home8.png',
  112. home10: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home10.png',
  113. home11: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home11.png',
  114. },
  115. thirdPlatform: [],
  116. mysNavConfig: {
  117. isHome: false,
  118. /* 固定导航 */
  119. navFixed: true,
  120. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  121. navTitle: {
  122. text: "信息确认",
  123. color: "",
  124. fontSize: "32rpx", // px upx rpx
  125. fontWeight: "", // 100 - 700
  126. },
  127. btnType: "type2",
  128. onLeftClick: '',
  129. /* type2 按钮 */
  130. type2Config: {
  131. // 左图标
  132. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  133. // 右图标
  134. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  135. // 圆角
  136. radius: "40rpx",
  137. },
  138. },
  139. }
  140. },
  141. onShow() {
  142. // 根据address_id查询address
  143. this.getDefaultAddress();
  144. // 查询account
  145. this.getAccount();
  146. },
  147. onLoad(options) {
  148. this.textObj = options.textObj.replace(/""/g, "");
  149. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  150. console.log(this.textObj)
  151. this.project = this.textObj.information
  152. this.strategy = this.textObj.strategy
  153. // console.log(this.project)
  154. for (let i = 0; i < this.project.Product.ProductPhoto.length; ++i) {
  155. if (this.project.Product.ProductPhoto[i].Symbol === 1) {
  156. this.mainImg = this.project.Product.ProductPhoto[i].PhotoUrl
  157. }
  158. }
  159. this.strategy.show_followers_low = fansview(this.strategy.followers_low)
  160. this.strategy.show_followers_up = fansview(this.strategy.followers_up)
  161. },
  162. methods: {
  163. getAccount() {
  164. this.$https.get('/youngee/c/t/g/get-talent-account')
  165. .then(res => {
  166. console.log(res)
  167. if (res.data.code !== -3) {
  168. let account = res.data.data
  169. while (this.project == null) {}
  170. for (var i = 0; i < account.length; i++) {
  171. if (this.project.project_platform == account[i].platform_id) {
  172. this.account = account[i]
  173. }
  174. }
  175. this.account.show_fans_count = fansview(this.account.fans_count)
  176. }
  177. })
  178. },
  179. getDefaultAddress() {
  180. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  181. console.log(res.data.data)
  182. this.address = res.data.data;
  183. let a = this.address.region_code.toString().slice(0, 2)
  184. let b = this.address.region_code.toString().slice(0, 4)
  185. let c = 0
  186. for (var i = 0; i < region.length; i++) {
  187. if (region[i].code == a) {
  188. a = region[i].name
  189. for (var j = 0; j < region[i].children.length; j++) {
  190. if (region[i].children[j].code == b) {
  191. b = region[i].children[j].name
  192. for (var o = 0; o < region[i].children[j].children.length; o++) {
  193. if (region[i].children[j].children[o].code == this.address
  194. .region_code) {
  195. c = region[i].children[j].children[o].name
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  203. })
  204. },
  205. editAddress() {
  206. uni.navigateTo({
  207. url: '/pages/mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  208. '&ismodify=1'
  209. });
  210. },
  211. editAccount() {
  212. uni.navigateTo({
  213. url: '/pages/mycenter/myinformation/bindaccount?platform_id=' + this.account.platform_id +
  214. '&account_id=' +
  215. this.account.account_id
  216. });
  217. },
  218. debugSubmit() {
  219. uni.navigateTo({
  220. url: '/pages/tasksquare/success'
  221. });
  222. },
  223. // 提交确认报名
  224. submit() {
  225. console.log(this.project)
  226. // 1. 判断任务是否截止
  227. this.$https.get('/youngee/c/t/g/get-project-detail' +
  228. "?" +
  229. "projectid" +
  230. "=" +
  231. this.project.project_id
  232. ).then(res => {
  233. console.log(res)
  234. // 当前时间
  235. var newdate = new Date()
  236. // 截止时间
  237. var endTime = new Date(res.data.data.recruit_ddl.replace(/-/g, "/"));
  238. console.log(endTime)
  239. if (endTime - newdate < 0) {
  240. // 招募截止
  241. uni.showToast({
  242. title: "任务已结束",
  243. duration: 1000,
  244. });
  245. uni.navigateTo({
  246. url: '/pages/tasksquare/tasksquare'
  247. });
  248. }
  249. })
  250. // 2. 判断粉丝量是否符合条件
  251. if (this.account.fans_count < this.strategy.followers_low) {
  252. // 招募截止
  253. uni.showToast({
  254. title: "粉丝量不达标",
  255. duration: 1000,
  256. });
  257. } else {
  258. // 3. 插入一条任务
  259. this.$https.post('/youngee/c/t/p/sign-up-task', {
  260. address_id: this.address.address_id,
  261. project_id: this.project.project_id,
  262. strategy_id: this.strategy.strategy_id,
  263. offer: this.strategy.offer,
  264. }).then(res => {
  265. if (res.data.code == 0) {
  266. var data = {
  267. task_id: res.data.data
  268. };
  269. data = JSON.stringify(data)
  270. uni.navigateTo({
  271. url: '/pages/tasksquare/success?textObj=' + encodeURIComponent(data)
  272. });
  273. } else {
  274. uni.showModal({
  275. content: '网络繁忙,请小主稍后再试~',
  276. });
  277. }
  278. })
  279. }
  280. },
  281. // 信息表
  282. getInfoList() {
  283. this.$http.get('/youngee/c/g/get-info-tables')
  284. .then(res => {
  285. this.hobby = []
  286. console.log(res)
  287. this.thirdPlatform = res.data.data.ThirdPlatform
  288. for (var i = 0; i < this.listsrc.length; i++) {
  289. var obj = {}
  290. obj.text = this.listsrc[i].platform_name
  291. obj.value = this.listsrc[i].id
  292. this.hobby.push(obj)
  293. }
  294. })
  295. },
  296. }
  297. }
  298. </script>
  299. <style lang="scss" scoped>
  300. text {
  301. font-size: 30rpx;
  302. }
  303. .basicInfo {
  304. display: flex;
  305. margin: 0 40rpx;
  306. padding: 30rpx 0;
  307. .basicInfo_txt {
  308. margin-left: 40rpx;
  309. padding-top: 20rpx;
  310. }
  311. }
  312. .address {
  313. display: flex;
  314. margin: 30rpx 40rpx 0;
  315. padding: 30rpx 0;
  316. justify-content: space-around;
  317. .address_icon {
  318. vertical-align: middle;
  319. width: 50rpx;
  320. height: 50rpx;
  321. display: inline-block;
  322. padding-right: 30rpx;
  323. }
  324. .address_edit {}
  325. .address_edit image {
  326. vertical-align: middle;
  327. width: 50rpx;
  328. height: 50rpx;
  329. display: inline-block;
  330. padding-right: 14rpx;
  331. }
  332. .ipon {
  333. color: #333333;
  334. font-size: 30rpx;
  335. margin-bottom: 10rpx;
  336. }
  337. }
  338. .keyInfo {
  339. margin: 30rpx 40rpx;
  340. .keyInfo_task {
  341. color: #000;
  342. .keyInfo_task_txt {
  343. border-radius: 10rpx;
  344. }
  345. }
  346. }
  347. .keyInfo h3 {}
  348. .keyInfo p {
  349. font-size: 30rpx;
  350. }
  351. .account {
  352. display: flex;
  353. align-items: center;
  354. width: 690rpx;
  355. padding: 24rpx 0;
  356. margin: 0 auto;
  357. .account_txt {
  358. display: inline-block;
  359. padding: 0 0 0 1%;
  360. width: 400rpx;
  361. }
  362. .account_txt span {
  363. color: #333333;
  364. font-weight: 550;
  365. text-indent: 2em;
  366. font-size: 30rpx;
  367. }
  368. .account_txt image {
  369. vertical-align: middle;
  370. width: 50rpx;
  371. height: 50rpx;
  372. display: inline-block;
  373. padding-right: 14rpx;
  374. }
  375. .account_fans {
  376. display: flex;
  377. width: 250rpx;
  378. }
  379. .account_fans p {
  380. display: inline-block;
  381. font-size: 30rpx;
  382. color: #333333;
  383. font-weight: 550;
  384. }
  385. .account_btn {}
  386. }
  387. .block {
  388. width: 100%;
  389. height: 100rpx;
  390. margin-top: 5%;
  391. }
  392. .submit {
  393. box-shadow: 0rpx 5rpx 40rpx #ccc;
  394. width: 100%;
  395. position: fixed;
  396. bottom: 0rpx;
  397. display: flex;
  398. height: 90rpx;
  399. padding-top: 2%;
  400. background-color: #FFFFFF;
  401. .submit_btn {
  402. width: 60%;
  403. background-color: #FCCF41;
  404. border-radius: 20rpx;
  405. font-size: 36rpx;
  406. line-height: 200%;
  407. letter-spacing: 10rpx;
  408. height: 80%;
  409. }
  410. }
  411. </style>