information.vue 11 KB

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